Nishieee commented on code in PR #351:
URL: https://github.com/apache/hugegraph-ai/pull/351#discussion_r3335252435
##########
hugegraph-llm/src/hugegraph_llm/api/models/rag_requests.py:
##########
@@ -164,3 +165,53 @@ def validate_prompt_placeholders(cls, v):
if missing:
raise ValueError(f"Prompt template is missing required
placeholders: {', '.join(missing)}")
return v
+
+
+class GraphExtractRequest(BaseModel):
+ model_config = ConfigDict(populate_by_name=True)
+
+ texts: Union[str, List[str]] = Field(..., description="Text or list of
texts to extract a graph from.")
+ graph_schema: Union[str, Dict[str, Any]] = Field(
+ ...,
+ alias="schema",
+ description="Graph schema as a JSON string/object, or an existing
graph name.",
Review Comment:
Added optional client_config to GraphExtractRequest and apply it in
graph_extract_api() before scheduling the flow, so callers using a named graph
schema (e.g. "custom_graph") can pass HugeGraph connection settings per request
instead of mutating shared /config/graph state first. Added tests in
test_graph_api.py to confirm client_config is applied for named schemas and
skipped when omitted.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]