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

feat: Vision models support in Anthropic #32103

Merged
merged 13 commits into from
Apr 16, 2024

Conversation

vivonk
Copy link
Contributor

@vivonk vivonk commented Mar 27, 2024

Description

Adding new vision models support in Anthropic
Screenshot 2024-04-12 at 15 59 06

Fixes https://github.com/appsmithorg/appsmith-ee/issues/3681

Automation

/ok-to-test tags="@tag.Datasource"

🔍 Cypress test results

Tip

🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/8706176169
Commit: 2c393e7
Cypress dashboard url: Click here!

Summary by CodeRabbit

  • New Features

    • Enhanced chat functionality with version upgrade and refined message creation process.
    • Added vision-related commands for handling image and text data in the Anthropic plugin.
    • Expanded constants to support new messaging and vision features.
    • Introduced new fields in request models to support system prompts and messages, while deprecating older fields.
    • Implemented a VisionCommand in method strategy for better handling of vision tasks.
    • Improved utility functions for message handling and configuration value extraction.
  • Refactor

    • Streamlined request URI construction to support new vision functionality alongside chat commands.
    • Removed unused constants and methods to clean up the codebase.

Copy link
Contributor

coderabbitai bot commented Mar 27, 2024

Walkthrough

The update enhances the Anthropic plugin by improving request serialization, refining command functionalities, and introducing vision-related capabilities. It streamlines JSON request creation, refactors chat command operations, enhances message handling, and lays the groundwork for vision command functionalities. Constants and utility functions are updated to support these changes, ensuring a more robust interaction with the Anthropic API.

Changes

File(s) Summary
.../AnthropicPlugin.java Introduced objectMapper for serializing anthropicRequestDTO to JSON and improved error handling.
.../commands/ChatCommand.java Updated chat command operations, refactored methods, and improved message handling.
.../commands/VisionCommand.java Added vision-related command functionality for HTTP request creation and message processing.
.../constants/AnthropicConstants.java,
.../utils/AnthropicMethodStrategy.java,
.../utils/RequestUtils.java
Added and updated constants, enhanced URI construction, and method strategy for vision commands.
.../models/AnthropicRequestDTO.java,
.../models/Message.java
Introduced new fields in AnthropicRequestDTO and added Message class for message content handling.
.../utils/CommandUtils.java Provided utility functions for message handling and configuration value extraction.

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>.
    • 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 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.

@github-actions github-actions bot added the Enhancement New feature or request label Mar 27, 2024
@vivonk
Copy link
Contributor Author

vivonk commented Mar 27, 2024

/build-deploy-preview --skip-tests=true

Copy link

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/8450353422.
Workflow: On demand build Docker image and deploy preview.
skip-tests: . env: .
PR: 32103.
recreate: .

@vivonk vivonk added the ok-to-test Required label for CI label Mar 27, 2024
Copy link

Failed server tests

  • com.external.plugins.AnthropicPluginTest#verifyDatasourceTriggerResultsForChatModels
  • com.external.plugins.ChatCommandTest#testCreateExecutionUri
  • com.external.plugins.ChatCommandTest#testMakeRequestBody_withValidData

1 similar comment
Copy link

Failed server tests

  • com.external.plugins.AnthropicPluginTest#verifyDatasourceTriggerResultsForChatModels
  • com.external.plugins.ChatCommandTest#testCreateExecutionUri
  • com.external.plugins.ChatCommandTest#testMakeRequestBody_withValidData

@vivonk
Copy link
Contributor Author

vivonk commented Mar 28, 2024

/build-deploy-preview --skip-tests=true

Copy link

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/8466655993.
Workflow: On demand build Docker image and deploy preview.
skip-tests: . env: .
PR: 32103.
recreate: .

Copy link

Failed server tests

  • com.appsmith.server.solutions.ApplicationForkingServiceTests#forkApplication_WhenContainsInternalFields_InternalFieldsNotForked

Copy link

Deploy-Preview-URL: https://ce-32103.dp.appsmith.com

@vivonk
Copy link
Contributor Author

vivonk commented Mar 28, 2024

/build-deploy-preview --skip-tests=true

Copy link

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/8467958122.
Workflow: On demand build Docker image and deploy preview.
skip-tests: . env: .
PR: 32103.
recreate: .

Copy link

Failed server tests

  • com.external.plugins.AnthropicPluginTest#verifyDatasourceTriggerResultsForChatModels

1 similar comment
Copy link

Failed server tests

  • com.external.plugins.AnthropicPluginTest#verifyDatasourceTriggerResultsForChatModels

@vivonk
Copy link
Contributor Author

vivonk commented Mar 29, 2024

/build-deploy-preview --skip-tests=true

Copy link

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/8477630495.
Workflow: On demand build Docker image and deploy preview.
skip-tests: . env: .
PR: 32103.
recreate: .

Copy link

Failed server tests

  • com.appsmith.server.services.PageServiceTest#createPageWithNullName

Copy link

Deploy-Preview-URL: https://ce-32103.dp.appsmith.com

Copy link

github-actions bot commented Apr 3, 2024

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/8537297651.
Workflow: On demand build Docker image and deploy preview.
skip-tests: . env: .
PR: 32103.
recreate: .

@vivonk
Copy link
Contributor Author

vivonk commented Apr 3, 2024

/build-deploy-preview --skip-tests=true --recreate=true

@vivonk
Copy link
Contributor Author

vivonk commented Apr 11, 2024

/build-deploy-preview --skip-tests=true

Copy link

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/8644329228.
Workflow: On demand build Docker image and deploy preview.
skip-tests: . env: .
PR: 32103.
recreate: .

Copy link

Deploy-Preview-URL: https://ce-32103.dp.appsmith.com

Copy link
Contributor

@sondermanish sondermanish left a comment

Choose a reason for hiding this comment

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

Minor change required in the migration, rest looks fine

@vivonk
Copy link
Contributor Author

vivonk commented Apr 15, 2024

/build-deploy-preview --skip-tests=true

Copy link

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/8687593093.
Workflow: On demand build Docker image and deploy preview.
skip-tests: . env: .
PR: 32103.
recreate: .

Copy link

Failed server tests

  • com.appsmith.server.solutions.ApplicationFetcherTest#getAllApplications_WhenUnpublishedPageExists_ReturnsApplications

Copy link

Deploy-Preview-URL: https://ce-32103.dp.appsmith.com

@vivonk vivonk added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels Apr 16, 2024
@vivonk vivonk enabled auto-merge (squash) April 16, 2024 12:29
@trishaanand trishaanand added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels Apr 16, 2024
@vivonk vivonk merged commit bc3d46d into release Apr 16, 2024
98 of 102 checks passed
@vivonk vivonk deleted the feat/anthropic-claude-vision-support branch April 16, 2024 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request ok-to-test Required label for CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants