New script ollama.py: AI auto-responder using Ollama#572
Open
prietus wants to merge 1 commit intoweechat:mainfrom
Open
New script ollama.py: AI auto-responder using Ollama#572prietus wants to merge 1 commit intoweechat:mainfrom
prietus wants to merge 1 commit intoweechat:mainfrom
Conversation
Member
|
Hi, Thank you for the script. Before your script can be integrated, please:
|
…ess_hashtable() feat: rework to use hook_url instead of requests feat: non-blocking Ollama script with hook_process_hashtable, no debug logs
flashcode
requested changes
Apr 23, 2025
| @@ -0,0 +1,2134 @@ | |||
| [33m0e021b6[m[33m ([m[1;36mHEAD[m[33m -> [m[1;32madd-ollama-bot[m[33m)[m New script ollama_bot.py: Adds non-blocking API calls using hook_process_hashtable() | |||
Member
There was a problem hiding this comment.
It seems this file has been committed by error, please remove it.
| @@ -0,0 +1,146 @@ | |||
| import weechat | |||
Member
There was a problem hiding this comment.
Please add SPDX tags for copyright/license, which have been made mandatory in the meanwhile (see Contributing guide), for example:
# SPDX-FileCopyrightText: 2025 teraflops <cprieto.ortiz@gmail.com>
#
# SPDX-License-Identifier: MIT
| - Can respond to private messages if enabled. | ||
| - Allows manual queries using the /ollama command. | ||
| - Configurable via WeeChat /set commands. | ||
| - Uses hook_url for non-blocking HTTP requests. |
Member
There was a problem hiding this comment.
This comment says it uses hook_url, but hook_process_hashtable is used instead.
Using hook_url has 2 advantages:
- it does not rely on an external curl command (which may not be available), but it still uses curl internally (linked with weechat)
- it uses a thread instead of a process, which is more lightweight.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Single commit, single file added
Commit message: New script ollama.py: AI auto-responder using Ollama
No similar script already exists
Name: max 32 chars, only lower case letters, digits and underscores
Unique name, does not already exist in repository
No shebang on the first line
Comment in script with name/pseudo, e-mail and license
Only English in code/comments
Pure WeeChat API used, no extra API
Function hook_process is used for any blocking call
For Python script: works with Python 3 (Python 2 support is optional)
Score 100 / 100 displayed by weechat-script-lint