sblakey / llm-bedrock-anthropic

Plugin for https://llm.datasette.io/en/stable/ to enable talking with Claude Instant and ClaudeV2 models on AWS Bedrock
Apache License 2.0
34 stars 11 forks source link

New option "-o bedrock_attach_files" for attaching images or documents to prompt. #15

Closed zalez closed 2 months ago

zalez commented 3 months ago

This pull request implements a new option "bedrock_attach_files" that allows this plugin to attach local files (images and documents) to the prompt. To implement this, it also adopted the Bedrock Converse API which allows this, replacing the old Anthropic-specific, standard Bedrock API. README.md documents this with some examples.

See details here: https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference.html

The code has been tested with some example pictures and documents.

This pull request also removes some unused code (generate_prompt_messages_v3() and execute_v3()) and cleans up some other stuff. Please ignore the 8c999fe commit because it assumed that pyproject.toml was supposed to work with Poetry, which it didn't. I replaced it with the original pyproject.toml.

Feel free to bump up the release number if it makes sense.