abyl2760
10/03/2025, 10:57 AMVaibhav (BAML 🐑)
10/03/2025, 12:04 PMVaibhav (BAML 🐑)
10/03/2025, 12:04 PMVaibhav (BAML 🐑)
10/03/2025, 12:05 PMabyl2760
10/03/2025, 1:30 PMasync def get_structured_answer_stream(
prompt: str, language: str, kb: KnowledgeBase, answer_found: List[bool] = None
):
def _get_baml_client():
return import_module("app.core.baml.baml_client.async_client").b
# Try Anthropic first
try:
print(
f"[SEGFAULT_DEBUG] Step 4-init: Creating Anthropic stream | Q: (passed in prompt)'",
flush=True,
)
stream = _get_baml_client().stream.ExtractChatAnswerAnthropic(prompt)
print(
f"[SEGFAULT_DEBUG] Step 4-stream: Anthropic stream created, starting iteration | Q: (passed in prompt)'",
flush=True,
)
async for result in _process_chat_stream(
stream, "Anthropic", language, kb, answer_found
):
yield result
return
except Exception as e:
logger.error(f"ExtractChatAnswerAnthropic failed: {e}")
logger.info("Falling back to ExtractChatAnswerGPT5")abyl2760
10/03/2025, 1:30 PMabyl2760
10/03/2025, 1:36 PMVaibhav (BAML 🐑)
10/03/2025, 4:16 PMaaronv (BAML)
10/03/2025, 5:13 PMabyl2760
10/04/2025, 7:33 PMVaibhav (BAML 🐑)
10/06/2025, 7:43 PM