Complete API reference for the Kubiya Knowledge service methods and classes
query(prompt: str, stream: bool = True, user_id: Optional[str] = None, org_id: Optional[str] = None) -> Union[Dict[str, Any], Generator[str, None, None]]
prompt
(str
): The query string to search for in the knowledge basestream
(bool
, optional): Whether to stream the response in real-time (default: True)user_id
(Optional[str]
): User ID for the query (optional)org_id
(Optional[str]
): Organization ID for the query (optional)Generator[str, None, None]
yielding event dataDict[str, Any]
containing the final response dataKnowledgeError
: If the query fails due to timeout, service unavailability, or other errorsKUBIYA_ORCHESTRATOR_URL
str
"https://orchestrator.kubiya.ai"
"https://your-orchestrator.domain.com"
KUBIYA_USE_SAME_API
bool
(as string)False
"true"
, "false"
KUBIYA_ORCHESTRATOR_URL
is set, use that URLKUBIYA_USE_SAME_API
is “true”, use the client’s base URLmessage
(str
): The error messagedetails
(Dict[str, Any]
): Additional error context and metadataknowledge_id
(Optional[str]
): Knowledge-related identifier if available