imbajin commented on code in PR #351:
URL: https://github.com/apache/hugegraph-ai/pull/351#discussion_r3333218282
##########
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:
‼️ **Add request-scoped graph config for named schemas**
Evidence: this field accepts an existing graph name, but this request model
has no `client_config` unlike `RAGRequest`, `GraphRAGRequest`, and
`GremlinGenerateRequest`, and `graph_extract_api()` schedules the flow without
applying graph config. Impact: callers must mutate shared `/config/graph` state
before using this programmatic endpoint, so concurrent requests can extract
against the wrong HugeGraph endpoint or credentials. Please either add and
apply request-local graph config for this endpoint, or require inline schema
JSON only.
--
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]