Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Merge branch 'fix_graph_prompt_path' into fix-issue-754
  • Loading branch information
dexters1 authored Apr 22, 2025
commit 317780e75331b551d31b7399c822866059b07784
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,18 @@ async def extract_content_graph(content: str, response_model: Type[BaseModel]):
llm_config = get_llm_config()

prompt_path = llm_config.get("GRAPH_PROMPT_PATH", "generate_graph_prompt.txt")

system_prompt = render_prompt(prompt_path, {})

# Check if the prompt path is an absolute path or just a filename
if os.path.isabs(prompt_path):
# directory containing the file
base_directory = os.path.dirname(prompt_path)
# just the filename itself
prompt_path = os.path.basename(prompt_path)
else:
base_directory = None

system_prompt = render_prompt(prompt_path, {}, base_directory=base_directory)

content_graph = await llm_client.acreate_structured_output(
content, system_prompt, response_model
)
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.