Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pr/update #83

Merged
merged 1 commit into from
Jan 6, 2025
Merged

pr/update #83

merged 1 commit into from
Jan 6, 2025

Conversation

khulnasoft-bot
Copy link
Contributor

@khulnasoft-bot khulnasoft-bot commented Jan 6, 2025

Category:

One of: Bugfix / Feature / Code style update / Refactoring Only / Build related changes / Documentation / Other (please specify)

Overview

Briefly outline your new changes...

Issue Number (if applicable) #00

New Vars (if applicable)

If you've added any new build scripts, environmental variables, config file options, dependency or devDependency, please outline here

Screenshot (if applicable)

If you've introduced any significant UI changes, please include a screenshot

Code Quality Checklist (Please complete)

  • All changes are backwards compatible
  • All lint checks and tests are passing
  • There are no (new) build warnings or errors
  • (If a new config option is added) Attribute is outlined in the schema and documented
  • (If a new dependency is added) Package is essential, and has been checked out for security or performance
  • (If significant change) Bumps version in package.json

Summary by Sourcery

Update project dependencies, updating langgraph, pyqt5, openai, langchain-google-genai, python-dotenv, upsonic, pyautogui, soundcard, sounddevice, soundfile, pydub, pyscreeze, pyperclip, pydantic, pillow, langchainhub, langchain-experimental, opentelemetry-sdk, opentelemetry-exporter-otlp, langchain-groq, langchain-openai, langchain, langchain-community, and langchain-core.

New Features:

  • Implement mouse scrolling functionality.
  • Implement functions to click on text, icons, and areas on the screen.
  • Add a screenshot tool to capture and explain the current screen.
  • Add system messages, user IDs, and AWS credentials saving and loading to the API.
  • Add Azure AI model support.
  • Add mouse scroll up/down API endpoints.
  • Add MCP server management API endpoints.
  • Implement a type verifier for tasks.
  • Add a task runner with retry functionality.
  • Add rich text support to the text edit.

Chores:

  • Add kot, screeninfo, anthropic, langchain-anthropic, StrEnum, langchain-mcp, waitress, langchain-aws, rich, and sentry-sdk.

Copy link

stackblitz bot commented Jan 6, 2025

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link

sourcery-ai bot commented Jan 6, 2025

Reviewer's Guide by Sourcery

This pull request updates the requirements.txt file, significantly reducing the number of required packages from 598 to 58. It also introduces several new packages and updates the versions of existing ones. Additionally, it modifies the display_tools.py file to include new functions for mouse scrolling, clicking on text or icons, and taking screenshots. It also updates the __init__.py file to include a new version number and several classes for managing instances and tasks. Finally, it modifies the api.py file to handle new API requests for mouse scrolling, adding MCP servers, and stopping the server.

Sequence diagram for task verification process

sequenceDiagram
    participant C as Client
    participant T as Task
    participant V as Verifier
    participant AI as AI Service
    C->>T: run()
    activate T
    T->>AI: request(description)
    AI-->>T: result
    T->>V: verify(description, result)
    activate V
    V->>AI: analyze_result()
    AI-->>V: verification_status
    alt verification failed
        V-->>T: raise Exception
        T->>AI: retry with feedback
        AI-->>T: new_result
        T->>V: verify(description, new_result)
    end
    V-->>T: verified result
    deactivate V
    T-->>C: final result
    deactivate T
Loading

Class diagram for new instance and task management

classDiagram
    class BaseClass {
        +screen_task: bool
        +add_client(client)
        +add_task(task)
        +sha_hash(text)
    }
    class BaseVerifier {
        +try_count: int
        +exception_return
        +verify()
    }
    class TypeVerifier {
        +type
        +feedback
        +verify(description, result)
    }
    class Task {
        +description: str
        +verifier: BaseVerifier
        +output: str
        +result
        +hash: str
        +run()
    }
    BaseClass <|-- BaseVerifier
    BaseVerifier <|-- TypeVerifier
    BaseClass <|-- Task
Loading

File-Level Changes

Change Details Files
Updated requirements
  • Reduced the number of required packages.
  • Introduced new packages like langgraph, anthropic, and langchain-anthropic.
  • Updated package versions, such as pyqt5, openai, and langchain-google-genai.
  • Removed many previously required packages like aiohttp, langchain, and openai
requirements.txt
Added mouse scrolling functionality
  • Introduced mouse_scroll_ function in display_tools.py to handle mouse scrolling.
  • Added API endpoints in api.py for mouse scroll up and down actions.
  • Implemented mouse_scroll_up and mouse_scroll_down functions in remote.py to interact with the API endpoints.
  • Added mouse_scroll tool to the available tools list in agent/agent.py
display_tools.py
api.py
remote.py
Implemented clicking on text and icons
  • Added click_to_text_ and click_to_icon_ functions in display_tools.py to click on text and icons respectively.
  • Added click_to_area_ function to click on specific areas on the screen.
  • Added extract_code_from_result function to extract JSON data from LLM output.
  • Added click_to_text, click_to_icon, and click_to_area tools to the available tools list in agent/agent.py
display_tools.py
Updated screenshot functionality
  • Modified screenshot_ function in display_tools.py to explain what to check on the screenshot.
  • Updated take_screenshot function in screen/shot.py to use screenshot_action_ from cu/computer.py.
  • Added screenshot tool to the available tools list in agent/agent.py
display_tools.py
screen/shot.py
Added instance and task management classes
  • Introduced BaseClass, BaseVerifier, TypeVerifier, and Task classes for managing instances and tasks.
  • Added instance, local_instance, local, cloud_instance, Cloud, docker_instance, and docker classes for different instance types.
  • Updated the __version__ variable.
  • Added new functions for starting and stopping the server, changing profiles, adding system messages, and getting logs in api.py
__init__.py
Improved API handling
  • Added new API endpoints for saving user ID, AWS credentials, system prompt, Anthropic API key, and API version.
  • Modified the /input endpoint to handle new parameters and return JSON responses.
  • Added a new /request endpoint to handle combined requests and responses.
  • Added endpoints for mouse scrolling and adding/stopping MCP servers.
  • Updated the start_api function to use waitress serve.
  • Added the_input function to handle input processing and return JSON responses.
  • Added error handling and logging to various API endpoints.
  • Added support for Azure AI models in llm_settings.py and gui/llmsettings.py
api.py
Updated database handling
  • Modified API key, OpenAI URL, system prompt, and API version saving and loading to use kot_db_.
  • Added functions for saving and loading AWS credentials.
  • Removed old functions for saving and loading user ID.
  • Added user_id.py for user ID management.
  • Added kot_db.py for managing the database using kot library.
  • Added folder.py for managing folder paths.
  • Added chat_history.py for managing chat history using kot library.
  • Added classes.py for managing classes related to tasks and verifiers.
  • Added base.py and run.py for base classes and running shell commands.
  • Added ask_anthropic.py for asking questions to Anthropic models.
  • Added computer.py for computer-related actions like mouse movements and clicks.
  • Added mcp/tool.py for managing MCP tools.
  • Added version.py for getting the current version of the package.
  • Updated requirements.in and setup.py to include new dependencies and package structure.
  • Updated llm.py to support Anthropic, AWS Bedrock, and Azure OpenAI models.
  • Updated agent/agent.py to use langgraph for agent execution and include new tools.
  • Updated start.py to start the API server using waitress.
  • Updated agent/agent_tools.py to remove default tools.
  • Updated screen/shot.py to use screenshot_action_ from cu/computer.py.
  • Updated audio/record.py to use speech_to_text from audio/stt.py.
  • Updated standard_tools.py to add keyboard_write, keyboard_press, and run_terminal_command tools and remove copy tool.
  • Updated llm_settings.py to include settings for Anthropic and AWS Bedrock models.
  • Updated gui/llmsettings.py to support Azure AI models and API version.
  • Updated remote.py to add new API calls for user ID, AWS credentials, system prompt, Anthropic API key, API version, MCP servers, and mouse scrolling.
  • Updated gpt_computer_agent.py to use new agent and assistant imports, update placeholder text, and handle shift+enter for new lines.
  • Updated agent/process.py to use agent instead of assistant, add just_screenshot parameter, and improve error handling.
  • Updated agent/chat_history.py to use ChatHistory class for managing chat history.
  • Updated display_tools.py to add new tools for mouse scrolling, clicking, and taking screenshots.
  • Updated __init__.py to include new classes and functions for managing instances and tasks.
  • Updated version number to 0.28.3 in __init__.py and setup.py
utils/db.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

coderabbitai bot commented Jan 6, 2025

Warning

Rate limit exceeded

@khulnasoft-bot has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 12 minutes and 31 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between e7b6f2a and e60d2a8.

📒 Files selected for processing (31)
  • gpt_computer_agent/__init__.py (1 hunks)
  • gpt_computer_agent/agent/agent.py (3 hunks)
  • gpt_computer_agent/agent/agent_tools.py (2 hunks)
  • gpt_computer_agent/agent/chat_history.py (2 hunks)
  • gpt_computer_agent/agent/process.py (17 hunks)
  • gpt_computer_agent/api.py (9 hunks)
  • gpt_computer_agent/audio/record.py (3 hunks)
  • gpt_computer_agent/classes.py (1 hunks)
  • gpt_computer_agent/cu/ask_anthropic.py (1 hunks)
  • gpt_computer_agent/cu/base.py (1 hunks)
  • gpt_computer_agent/cu/computer.py (1 hunks)
  • gpt_computer_agent/cu/run.py (1 hunks)
  • gpt_computer_agent/display_tools.py (1 hunks)
  • gpt_computer_agent/gpt_computer_agent.py (11 hunks)
  • gpt_computer_agent/gui/llmsettings.py (8 hunks)
  • gpt_computer_agent/llm.py (4 hunks)
  • gpt_computer_agent/llm_settings.py (5 hunks)
  • gpt_computer_agent/mcp/tool.py (1 hunks)
  • gpt_computer_agent/remote.py (7 hunks)
  • gpt_computer_agent/screen/shot.py (2 hunks)
  • gpt_computer_agent/standard_tools.py (4 hunks)
  • gpt_computer_agent/start.py (2 hunks)
  • gpt_computer_agent/utils/chat_history.py (1 hunks)
  • gpt_computer_agent/utils/db.py (3 hunks)
  • gpt_computer_agent/utils/folder.py (1 hunks)
  • gpt_computer_agent/utils/kot_db.py (1 hunks)
  • gpt_computer_agent/utils/user_id.py (1 hunks)
  • gpt_computer_agent/version.py (1 hunks)
  • requirements.in (3 hunks)
  • requirements.txt (1 hunks)
  • setup.py (1 hunks)

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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.
    • @coderabbitai help me debug CodeRabbit configuration file.

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 using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration 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 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 for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have skipped reviewing this pull request. It seems to have been created by a bot (hey, khulnasoft-bot!). We assume it knows what it's doing!

@FortiShield FortiShield merged commit 2e2cac7 into master Jan 6, 2025
14 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants