summaryrefslogtreecommitdiff
path: root/py (follow)
Commit message (Collapse)AuthorAgeFiles
* special roleMartin Bielik2024-12-173
|
* introduced pre-defined default rolesMartin Bielik2024-12-173
|
* simplified new role syntaxMartin Bielik2024-12-171
|
* command-type only rolesMartin Bielik2024-12-162
|
* new role syntaxMartin Bielik2024-12-162
|
* edit command roleMartin Bielik2024-12-161
|
* refactoring: import python when needed, run as functionsMartin Bielik2024-12-165
|
* refactoring: make prompt in pythonMartin Bielik2024-12-154
|
* unified config parsing + testsMartin Bielik2024-12-154
|
* fixed roles parsingmainMartin Bielik2024-12-121
|
* fixed complete command roles after refactoringMartin Bielik2024-12-123
|
* execute mutliple rolesMartin Bielik2024-12-121
|
* fix(utils): improve response mappingJason Kölker2024-12-111
| | | | | | | | | | | | | | | | | | | Make the reponse mapping more robust by checking for an empty (or missing) `choices` list and substitute a list with an empty dictionary. Use `.get` to access the `message` or `delta` object again returning an empty dictionary if they are not found. When using `hermes3-405b` on lambda cloud's inference (based on openrouter) a final response was returned with an empty list for choices causing a traceback on completion. Debug log: ``` [2024-12-11 19:49:11.925592] [engine-chat] response: {'id': 'chatcmpl-140a7a938d2149c8a750f47af6a11be1', 'object': 'chat.completion.chunk', 'created': 1733946550, 'model': 'hermes3-405b', 'choices': [{'index': 0, 'delta': {'content': ' today'}, 'finish_reason': None, 'content_filter_results': {'hate': {'filtered': False}, 'self_harm': {'filtered': False}, 'sexual': {'filtered': False}, 'violence': {'filtered': False}, 'jailbreak': {'filtered': False, 'detected': False}, 'profanity': {'filtered': False, 'detected': False}}}], 'system_fingerprint': '', 'usage': {'prompt_tokens': 40, 'completion_tokens': 18, 'total_tokens': 58, 'prompt_tokens_details': None, 'completion_tokens_details': None}} [2024-12-11 19:49:11.975457] [engine-chat] response: {'id': 'chatcmpl-140a7a938d2149c8a750f47af6a11be1', 'object': 'chat.completion.chunk', 'created': 1733946550, 'model': 'hermes3-405b', 'choices': [{'index': 0, 'delta': {'content': '?'}, 'finish_reason': None, 'content_filter_results': {'hate': {'filtered': False}, 'self_harm': {'filtered': False}, 'sexual': {'filtered': False}, 'violence': {'filtered': False}, 'jailbreak': {'filtered': False, 'detected': False}, 'profanity': {'filtered': False, 'detected': False}}}], 'system_fingerprint': '', 'usage': {'prompt_tokens': 40, 'completion_tokens': 19, 'total_tokens': 59, 'prompt_tokens_details': None, 'completion_tokens_details': None}} [2024-12-11 19:49:12.008987] [engine-chat] response: {'id': 'chatcmpl-140a7a938d2149c8a750f47af6a11be1', 'object': 'chat.completion.chunk', 'created': 1733946550, 'model': 'hermes3-405b', 'choices': [{'index': 0, 'delta': {}, 'finish_reason': 'stop', 'content_filter_results': {'hate': {'filtered': False}, 'self_harm': {'filtered': False}, 'sexual': {'filtered': False}, 'violence': {'filtered': False}, 'jailbreak': {'filtered': False, 'detected': False}, 'profanity': {'filtered': False, 'detected': False}}}], 'system_fingerprint': '', 'usage': {'prompt_tokens': 40, 'completion_tokens': 20, 'total_tokens': 60, 'prompt_tokens_details': None, 'completion_tokens_details': None}} [2024-12-11 19:49:12.009400] [engine-chat] response: {'id': 'chatcmpl-140a7a938d2149c8a750f47af6a11be1', 'object': 'chat.completion.chunk', 'created': 1733946550, 'model': 'hermes3-405b', 'choices': [], 'system_fingerprint': '', 'usage': {'prompt_tokens': 40, 'completion_tokens': 19, 'total_tokens': 59, 'prompt_tokens_details': None, 'completion_tokens_details': None}} ```
* print prompt in debug modeMartin Bielik2024-12-082
|
* Merge pull request #136 from drujensen/feature/fix-grok-xaiMartin Bielik2024-12-071
|\ | | | | fix: grok xai blocks without user agent, fixes #136 104
| * fix: grok xai blocks without user agentDru Jensen2024-12-071
| |
* | fixed options normalizationMartin Bielik2024-12-073
|/
* fix debug logging without argumentsMartin Bielik2024-12-071
|
* allow override global token configMartin Bielik2024-12-061
|
* fixed stream=0 in chat engineMartin Bielik2024-12-053
|
* escaping error messageMartin Bielik2024-12-051
|
* o1 support - max_completion_tokensMartin Bielik2024-12-031
|
* Merge branch 'main' into support-non-streamingMartin Bielik2024-12-031
|\
| * improved error handling, fixes #126Martin Bielik2024-11-081
| |
* | support non streaming apiMartin Bielik2024-10-083
|/
* fixes #110, python compatibility issue with escape sequenceMartin Bielik2024-06-111
|
* Fix print_info_message <Esc> issueMichael Buckley2024-06-041
| | | | | | | | | | | | | | | | | | | | | I ran into an issue when first using this plugin where the print_info_message function wasn't working correctly due to vim misinterpreting the <Esc> sequence in `vim.command("normal \\<Esc>")` as a series of individual characters rather than a single literal Escape character. This resulted in the characters 'c>' being inserted into the active buffer at the cursor location because the 's' in '<Esc>' was being interpreted as a normal mode 's', causing it to enter insert mode, and none of the info messages were being echoed properly. This was frustrating as it was not easy to figure out why my commands weren't working initially (turns out I hadn't configured my billing plan correctly, d'oh). Fix this by using a more robust way of sending the <Esc> character to vim via `vim.command('call feedkeys("\<Esc>")')`. The usage of double quotes inside the feedkeys() call is important because it causes vim to treat the sequence as a proper escape sequence rather than a series of individual characters (see :h feedkeys).
* reusing parsing codeMartin Bielik2024-03-242
|
* optionally supplement roles dict by vim function sourceKonfekt2024-03-112
| | | | | | | | | | | | | | | | | | | | | | | The application was restricted to loading role configurations only from a predefined config file, which limited extensibility. Enable dynamic role configuration by invoking a custom Vim function if it is defined. This allows users to extend the role configurations beyond the static file. diff --git a/doc/vim-ai.txt b/doc/vim-ai.txt: -The roles in g:vim_ai_roles_config_file are converted to a Vim dictionary. -Optionally, additional roles can be added by defining a function VimAIRoleParser() -whose output is a dictionary of the same format as g:vim_ai_roles_config_file. - diff --git a/py/roles.py b/py/roles.py: -if vim.eval('exists("*VimAIRoleParser")'): - roles.update(vim.eval('VimAIRoleParser()')) - diff --git a/py/utils.py b/py/utils.py: - if vim.eval('exists("*VimAIRoleParser")'): - roles.update(vim.eval('VimAIRoleParser()')) -
* Ensure role config file exists before loading to prevent errorsKonfekt2024-03-101
| | | | | | | | | | | The problem was that the application tried to load a roles configuration file without checking whether it actually exists, potentially leading to unhandled exceptions if the file is missing. Ensure that the roles configuration file exists before attempting to read from it; raise an exception with a clear message if the file is not found. diff --git a/py/roles.py b/py/roles.py: -if not os.path.exists(roles_config_path): - raise Exception(f"Role config file does not exist: {roles_config_path}") -
* supprot config only rolesMartin Bielik2024-03-091
|
* simple error handlingMartin Bielik2024-03-091
|
* fix using role in existing chatMartin Bielik2024-03-091
|
* roles example fileMartin Bielik2024-03-092
|
* roles completionMartin Bielik2024-03-091
|
* parse role optionsMartin Bielik2024-03-093
|
* read role prompt from configMartin Bielik2024-03-093
|
* removed config path logMartin Bielik2024-03-091
|
* feat: add an option to customize api key file locationjiangyinzuo2024-03-081
|
* feat(chat): add `include` role to include filesJason Kölker2024-01-241
| | | | | | | | | | | | | | | | | | | | | | | | | Files may be included in the chat by a special `include` role. Each file's contents will be added to an additional `user` role message with the files separated by `==> {path} <==` where `{path}` is the path to the file. Globbing is expanded out via `glob.glob` and relative apths to the current working directory (as determined by `getcwd()`) will be resolved to absolute paths. Example: ``` >>> user Generate documentation for the following files >>> include /home/user/myproject/src/../requirements.txt /home/user/myproject/**/*.py ``` Fixes: #69
* import vim before utils, fixes #43Martin Bielik2023-12-232
|
* added explaining commentMartin Bielik2023-12-021
|
* fix selection include extra content when the user is in visual modecposture2023-12-023
|
* fixed python3.12 slash escaping, fixes #61Martin Bielik2023-11-011
|
* removed unused importMartin Bielik2023-10-212
|
* Merge remote-tracking branch 'origin/main' into base-url-configMartin Bielik2023-10-211
|\
| * Include OpenAI Org ID from the token configDuy Lam2023-09-091
| |
* | endpoint_url configMartin Bielik2023-10-212
| |
* | option to disable authorizationMartin Bielik2023-10-211
| |
* | base_url extracted to config, docuMartin Bielik2023-10-212
| |