Merge pull request #1508 from balaji-munusamy/make-bedrock-complete-generic

Made bedrock_complete generic
This commit is contained in:
Daniel.y
2025-05-03 01:00:19 +08:00
committed by GitHub

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,