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

[editor] Claude Bedrock Prompt Schema #1050

Merged
merged 2 commits into from
Jan 29, 2024
Merged

[editor] Claude Bedrock Prompt Schema #1050

merged 2 commits into from
Jan 29, 2024

Conversation

Ankush-lastmile
Copy link
Member

@Ankush-lastmile Ankush-lastmile commented Jan 27, 2024

[editor] Claude Bedrock Prompt Schema

Testplan

claude.testplan.mov

Stack created with Sapling. Best reviewed with ReviewStack.

items: {
type: "string",
},
description: `Sequences that will cause the model to stop generating.`,
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't really understand this but that's fine, just from official documentation. As long as we have a good cookbook with local editor should be cool

Copy link
Member Author

Choose a reason for hiding this comment

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

here's an example to help you visualize it
Screenshot 2024-01-29 at 5 38 40 PM

description: `An object describing metadata about the request. (Claude specific)`,
}
},
required: ["model", "max_tokens_to_sample", "stop_sequences"],
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice!

@@ -81,6 +82,8 @@ export const PROMPT_SCHEMAS: Record<string, PromptSchema> = {
"dall-e-2": DalleImageGenerationParserPromptSchema,
"dall-e-3": DalleImageGenerationParserPromptSchema,

"ClaudeBedrockModelParser": ClaudeBedrockPromptSchema,
Copy link
Contributor

Choose a reason for hiding this comment

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

So just to be clear, the "model_name" is "Claude" when we register it in the core model parsers?
Do we also need to do "Claude": ClaudeBedrockPromptSchema?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes we would need to register it as well

Copy link
Member Author

Choose a reason for hiding this comment

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

discussed offline, we'll get rid of "Claude" for now

Ankush Pala ankush@lastmileai.dev added 2 commits January 29, 2024 17:31
Model Parser for Claude on AWS Bedrock



Claude on Bedrock can be called with the
- `anthropic_bedrock` python library
- AWS' `Boto3` Library
- Chose to use the `anthropic_bedrock` library because it has good abstractions and type hints

Claude on Bedrock only supports Text Completions, turn style [prompts are not supported](https://docs.anthropic.com/claude/reference/claude-on-amazon-bedrock#:~:text=Messages%20in%20Amazon%20Bedrock)

- Added Claude model parser as a core parser.
- added dependency on `anthropic_bedrock`



## Testplan

using prompt schema from diff ontop

https://github.com/lastmile-ai/aiconfig/assets/141073967/29c1faa7-7d13-412f-8606-9ad556eb1c52
@Ankush-lastmile Ankush-lastmile merged commit 13b1e76 into main Jan 29, 2024
2 checks passed
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.

2 participants