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

fix(searchtheweb): Fix the Jina Search Block #8583

Merged
merged 2 commits into from
Nov 7, 2024

Conversation

aarushik93
Copy link
Contributor

@aarushik93 aarushik93 commented Nov 7, 2024

Background

Jina needs an API key now

Changes πŸ—οΈ

Update to use credentials and move into jina folder

Screen.Recording.2024-11-07.at.5.21.20.PM.mov

Testing πŸ”

Note

Only for the new autogpt platform, currently in autogpt_platform/

  • Create from scratch and execute an agent with at least 3 blocks
  • Import an agent from file upload, and confirm it executes correctly
  • Upload agent to marketplace
  • Import an agent from marketplace and confirm it executes correctly
  • Edit an agent from monitor, and confirm it executes correctly

Configuration Changes πŸ“

Note

Only for the new autogpt platform, currently in autogpt_platform/

If you're making configuration or infrastructure changes, please remember to check you've updated the related infrastructure code in the autogpt_platform/infra folder.

Examples of such changes might include:

  • Changing ports
  • Adding new services that need to communicate with each other
  • Secrets or environment variable changes
  • New or infrastructure changes such as databases

@aarushik93 aarushik93 requested a review from a team as a code owner November 7, 2024 18:21
@aarushik93 aarushik93 requested review from Bentlybro and majdyz and removed request for a team November 7, 2024 18:21
Copy link

qodo-merge-pro bot commented Nov 7, 2024

PR Reviewer Guide πŸ”

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 3 πŸ”΅πŸ”΅πŸ”΅βšͺβšͺ
πŸ§ͺΒ No relevant tests
πŸ”’Β Security concerns

Sensitive information exposure:
The SearchTheWebBlock class in 'autogpt_platform/backend/backend/blocks/jina/search.py' includes an API key in the request headers. While it's using a SecretStr type, which is a good practice, ensure that this key is not logged or exposed in any way during runtime or in error messages.

⚑ Recommended focus areas for review

Error Handling
The SearchTheWebBlock class doesn't handle potential errors from the API request. Consider adding try-except blocks to catch and handle possible exceptions.

Unused Import
The 'groq' module is imported but not used in the code. Remove unused imports to improve code cleanliness.

Error Handling
The get_request method raises an exception on HTTP errors. Consider handling these exceptions more gracefully or providing more context in the error message.

ntindle
ntindle previously approved these changes Nov 7, 2024
@aarushik93 aarushik93 merged commit c25d03e into dev Nov 7, 2024
11 checks passed
@aarushik93 aarushik93 deleted the aarushikansal/search-the-web-block branch November 7, 2024 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants