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: Add anthropic image description #1436

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open

Conversation

kroist
Copy link

@kroist kroist commented Dec 24, 2024

Relates to:

Risks

Background

What does this PR do?

What kind of change is this?

Documentation changes needed?

Testing

Where should a reviewer start?

Detailed testing steps

Copy link
Collaborator

@monilpat monilpat left a comment

Choose a reason for hiding this comment

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

Thanks for doing this added a couple of comments to make this configurable after that good to go :)

@@ -97,11 +98,13 @@ export class ImageDescriptionService

if (model === models[ModelProviderName.LLAMALOCAL]) {
await this.initializeLocalModel();
} else if (model === models[ModelProviderName.ANTHROPIC]) {
this.modelId = "claude-3-haiku-20240307";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we make this a env var and add this hard coded value as a default?

Comment on lines +252 to +254
imageData,
400,
400
Copy link
Collaborator

Choose a reason for hiding this comment

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

You should be able to configure the dimensions of this can we pass that in as a param

// Detect MIME type
const fileTypeResult = await FileType.fileTypeFromBuffer(imageBuffer);
if (!fileTypeResult || !fileTypeResult.mime.startsWith("image/")) {
throw new Error("Invalid image format");
Copy link
Collaborator

Choose a reason for hiding this comment

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

please elizaLogger before errors thanks

},
},
};
} catch (error) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same here

@odilitime odilitime changed the base branch from main to develop December 25, 2024 00:29
@odilitime odilitime changed the title Add anthropic image description feat: Add anthropic image description Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants