LlmKira / Openaibot

⚑️ Build Your Own chatgpt Bot|πŸ§€ Discord/Slack/Kook/Telegram |β›“ ToolCall|πŸ”– Plugin Support | 🌻 out-of-box | gpt-4o
https://llmkira.github.io/Docs
Apache License 2.0
1.93k stars 229 forks source link

Add duckduckgo-search #405

Closed sudoskys closed 4 months ago

sudoskys commented 4 months ago

Summary by CodeRabbit

coderabbitai[bot] commented 4 months ago

Walkthrough

The recent updates primarily enhance functionality across various components of the llmkira project. Key changes include the addition of a new search function using DuckDuckGo, the switch from Edge TTS to Google's gTTS for text-to-speech, and improvements in message formatting with markdown across different messaging platforms. The login process and task execution conditions have also been refined, alongside general updates to dependencies and serialization methods.

Changes

File(s) Change Summary
README.md Updated login requirements and added Line as a platform.
app/middleware/llm_task.py Added warning log and mock message in pair_check.
app/receiver/function.py Modified chat continuation logic in task execution.
app/sender/.../__init__.py Unified removal of json import and adoption of dict2markdown for message formatting across Discord, Kook, Slack, and Telegram platforms.
app/sender/util_func.py Introduced dict2markdown function.
llmkira/extra/plugins/search/... Enhanced search functionality with DuckDuckGo integration and updated default behaviors in search functions.
llmkira/extra/voice/__init__.py Switched from Edge TTS to Google's gTTS for text-to-speech conversion.
llmkira/logic/__init__.py Enhanced LLMLogic with new serialization methods and added type imports.
pyproject.toml Updated project version and dependencies, including the switch from edge-tts to gTTS.

Recent Review Details **Configuration used: CodeRabbit UI** **Review profile: CHILL**
Commits Files that changed from the base of the PR and between 4beda0930ca1a5a5a59484d18105769819f4716e and 06bc9710dfa6b3d29e81c4cc5a2ad9f6165ca2a8.
Files ignored due to path filters (1) * `pdm.lock` is excluded by `!**/*.lock`
Files selected for processing (13) * README.md (2 hunks) * app/middleware/llm_task.py (1 hunks) * app/receiver/function.py (1 hunks) * app/sender/discord/__init__.py (3 hunks) * app/sender/kook/__init__.py (3 hunks) * app/sender/slack/__init__.py (4 hunks) * app/sender/telegram/__init__.py (4 hunks) * app/sender/util_func.py (1 hunks) * llmkira/extra/plugins/search/__init__.py (3 hunks) * llmkira/extra/plugins/search/engine.py (2 hunks) * llmkira/extra/voice/__init__.py (3 hunks) * llmkira/logic/__init__.py (4 hunks) * pyproject.toml (3 hunks)
Additional Context Used
LanguageTool (67)
README.md (67)
Near line 40: Possible spelling mistake found. Context: ...️ > Python>=3.9 This project uses the ToolCall feature. It integrates a message queui... --- Near line 42: β€˜prior to’ might be wordy. Consider a shorter alternative. Context: ...ng plugin mechanisms and authentication prior to plugin execution. The bot adheres to t... --- Near line 45: Possible spelling mistake found. Context: ...in execution. The bot adheres to the **Openai Format Schema**. Please adapt using [ga... --- Near line 46: Possible spelling mistake found. Context: ...ps://github.com/Portkey-AI/gateway) or [one-api](https://github.com/songquanpeng/one-ap... --- Near line 48: Possible typo: you repeated a whitespace Context: ...quanpeng/one-api) independently. | Demo | Vision With Voice ... --- Near line 48: Possible typo: you repeated a whitespace Context: ... | Vision With Voice | Code Interpreter ... --- Near line 48: Possible typo: you repeated a whitespace Context: ... | Code Interpreter | |-------------------------------------... --- Near line 81: Loose punctuation mark. Context: ...s ### πŸ” Login Modes - `Login via url`: Use `/login $/v1$<... --- Near line 84: The currency mark is usually put at the beginning of the number. Context: ...ents/credential.py#L20). - `Login`: Use `/login https:///v1$$$ # not must ``` use `/env VOICE_REPLY_ME=NONE` to disable t... --- Near line 209: This sentence does not start with an uppercase letter. Context: ...CE_REPLY_ME=NONE` to disable this env. check the source code in `llmkira/extra/voice... --- Near line 210: Possible spelling mistake found. Context: ...ble this env. check the source code in `llmkira/extra/voice_hook.py`, learn to write yo... --- Near line 218: Possible spelling mistake found. Context: ...m) ## πŸ“œ Notice > This project, named OpenAiBot, signifying "Open Artificial Intelligen...
Additional comments not posted (21)
pyproject.toml (2)
`3-3`: Version update to "1.0.4" is appropriate for introducing new features. --- `63-71`: > :memo: **NOTE** > This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [53-68] Dependency updates are correctly reflected in the file.
llmkira/logic/__init__.py (2)
`21-22`: Addition of boolean properties to classes enhances clarity and usability. Also applies to: 36-37 --- `89-131`: Addition of serialization and deserialization methods to `LLMLogic` class is well-implemented.
llmkira/extra/voice/__init__.py (1)
`102-110`: Modification to use Google's gTTS for text-to-speech conversion is correctly implemented.
llmkira/extra/plugins/search/__init__.py (2)
`26-34`: > :memo: **NOTE** > This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [20-31] Integration of `search_in_duckduckgo` as a fallback in `search_on_serper` is correctly implemented. --- `165-173`: Update to `function_response` to include additional information is well-implemented.
app/sender/util_func.py (1)
`228-232`: Addition of `dict2markdown` function to convert dictionary to markdown format is correctly implemented.
README.md (2)
`84-84`: Update to the login process to require an additional parameter for the tool model is correctly documented. --- `100-100`: Addition of Line as a platform with no support for triggering by reply is correctly documented.
app/middleware/llm_task.py (1)
`105-105`: Ensure the new warning log is integrated with the system's logging configuration.
app/receiver/function.py (2)
`276-279`: Ensure the condition string is correctly formatted and encapsulates all necessary details for the LLM to make an informed decision. --- `276-279`: Consider adding error handling for the LLM call to handle potential failures gracefully.
app/sender/slack/__init__.py (2)
`239-250`: > :memo: **NOTE** > This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [242-256] Ensure that `dict2markdown` correctly handles all edge cases, such as empty or complex data structures. --- `239-250`: > :memo: **NOTE** > This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [242-256] Consider adding error handling for the `dict2markdown` function to manage any potential formatting failures.
app/sender/kook/__init__.py (2)
`399-399`: Ensure that `dict2markdown` correctly handles all edge cases, such as empty or complex data structures. --- `399-399`: Consider adding error handling for the `dict2markdown` function to manage any potential formatting failures.
app/sender/telegram/__init__.py (2)
`239-252`: > :memo: **NOTE** > This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [243-260] Ensure that `dict2markdown` correctly handles all edge cases, such as empty or complex data structures. --- `239-252`: > :memo: **NOTE** > This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [243-260] Consider adding error handling for the `dict2markdown` function to manage any potential formatting failures.
app/sender/discord/__init__.py (2)
`38-38`: The addition of `dict2markdown` to the import list is noted. --- `394-394`: Using `dict2markdown` for formatting environment variables enhances readability. Ensure it handles edge cases like special characters or very large data sets.
--- Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Share - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)
Tips ### Chat There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai): - Review comments: Directly reply to a review comment made by CodeRabbit. Example: - `I pushed a fix in commit .` - `Generate unit testing code for this file.` - `Open a follow-up GitHub issue for this discussion.` - Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples: - `@coderabbitai generate unit testing code for this file.` - `@coderabbitai modularize this function.` - PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples: - `@coderabbitai generate interesting stats about this repository and render them as a table.` - `@coderabbitai show all the console.log statements in this repository.` - `@coderabbitai read src/utils.ts and generate unit testing code.` - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.` Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. ### CodeRabbit Commands (invoked as PR comments) - `@coderabbitai pause` to pause the reviews on a PR. - `@coderabbitai resume` to resume the paused reviews. - `@coderabbitai review` to trigger a review. This is useful when automatic reviews are disabled for the repository. - `@coderabbitai resolve` resolve all the CodeRabbit review comments. - `@coderabbitai help` to get help. Additionally, you can add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed. ### CodeRabbit Configration File (`.coderabbit.yaml`) - You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository. - Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information. - If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json` ### Documentation and Community - Visit our [Documentation](https://coderabbit.ai/docs) for detailed information on how to use CodeRabbit. - Join our [Discord Community](https://discord.com/invite/GsXnASn26c) to get help, request features, and share feedback. - Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.