made bedrock complete generic

This commit is contained in:
Balaji Munusamy
2025-05-02 18:25:48 +02:00
parent 7ccc3ffdd7
commit c3bc0eb53b

View File

@@ -94,12 +94,14 @@ async def bedrock_complete_if_cache(
return response["output"]["message"]["content"][0]["text"]
# Generic Bedrock completion function
async def bedrock_complete(
prompt, system_prompt=None, history_messages=[], keyword_extraction=False, **kwargs
) -> str:
keyword_extraction = kwargs.pop("keyword_extraction", None)
model_name = kwargs["hashing_kv"].global_config["llm_model_name"]
result = await bedrock_complete_if_cache(
"anthropic.claude-3-haiku-20240307-v1:0",
model_name,
prompt,
system_prompt=system_prompt,
history_messages=history_messages,