Skip to content

Allow custom assistant role message content in request body in AnthropicClaudeAdapter #1720

@tlam-lyra

Description

@tlam-lyra

Is your feature request related to a problem? Please describe.
I'd like to prefill assistant role message content (as outlined here in Claude's official doc: https://docs.anthropic.com/en/docs/build-with-claude/prompt-engineering/prefill-claudes-response) using AmazonBedrockGenerator component

Describe the solution you'd like
Add additional param in run method of AmazonBedrockGenerator component that allows prefilling custom assistant role message in request body for AnthropicClaudeAdapter using messages api

Current implementation does not allow such behavior. It only allows passing in user prompt but not prefilling Claude response through custom assistant role message content. See https://github.com/deepset-ai/haystack-core-integrations/blob/main/integrations/amazon_bedrock/src/haystack_integrations/components/generators/amazon_bedrock/adapters.py#L135-L148

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions