KnowledgeBaseQueryResponse

pydantic model openapi_client.models.knowledge_base_query_response.KnowledgeBaseQueryResponse

Response from POST /ai/knowledgebases/{id}/query.

Fields:
field guard_rail_intervention: Optional[StrictBool] = None (alias 'GuardRailIntervention')

Present when the model returns a dict. True if a guard rail blocked or modified the answer.

field guard_rail_intervention_reason: Optional[StrictStr] = None (alias 'GuardRailInterventionReason')

Guard rail reason when intervention occurred. Empty string when it did not.

field chunks_retrieved: Optional[List[ChunksRetrieved]] = None (alias 'ChunksRetrieved')

Chunks grouped by file. Empty when no accessible content is found or a guard rail blocks the answer.

field answer: Optional[StrictStr] = None (alias 'Answer')

Generated answer, or a message when no accessible content is found.

field metrics: Optional[Dict[str, Any]] = None (alias 'Metrics')

Optional token or invocation metrics when the model response includes Metadata.Metrics.

to_str()

Returns the string representation of the model using alias

Return type:

str

to_json()

Returns the JSON representation of the model using alias

Return type:

str

classmethod from_json(json_str)

Create an instance of KnowledgeBaseQueryResponse from a JSON string

Return type:

Optional[Self]

to_dict()

Return the dictionary representation of the model using alias.

This has the following differences from calling pydantic’s self.model_dump(by_alias=True):

  • None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.

Return type:

Dict[str, Any]

classmethod from_dict(obj)

Create an instance of KnowledgeBaseQueryResponse from a dict

Return type:

Optional[Self]