additional file changes

This commit is contained in:
Luke Wulf 2024-06-27 15:44:03 -07:00
parent f5c60690c1
commit 7e7c984d3c
2 changed files with 3 additions and 19 deletions

View File

@ -82,12 +82,8 @@ def load_personas_from_yaml(
persona_id=(-1 * p_id) if p_id is not None else None,
name=persona["name"],
description=persona["description"],
num_chunks=persona.get("num_chunks")
if persona.get("num_chunks") is not None
else default_chunks,
use_recent_documents=persona["use_recent_documents"]
if persona["use_recent_documents"] is not None
else False,
num_chunks=persona.get("num_chunks", default_chunks),
use_recent_documents=persona.get("use_recent_documents", False),
num_days=persona.get("num_days"),
llm_relevance_filter=persona.get("llm_relevance_filter"),
starter_messages=persona.get("starter_messages"),

View File

@ -248,20 +248,8 @@ class Answer:
)
if tool.name() == SearchTool.NAME:
final_context_documents = None
for response in tool_runner.tool_responses():
if response.id == FINAL_CONTEXT_DOCUMENTS:
final_context_documents = cast(list[LlmDoc], response.response)
yield response
self._update_prompt_builder_for_search_tool(prompt_builder, [])
if final_context_documents is None:
raise RuntimeError(
"SearchTool did not return final context documents"
)
self._update_prompt_builder_for_search_tool(
prompt_builder, final_context_documents
)
elif tool.name() == ImageGenerationTool.NAME:
prompt_builder.update_user_prompt(
build_image_generation_user_prompt(