Added in Python SDK 0.9.0 and JavaScript and TypeScript SDK 0.9.0. In TypeScript, pass one options object; every option is accepted in snake_case or camelCase (
customer_id or customerId). The result is returned as the server sends it, with snake_case fields, typed as Record<string, unknown>.knowledge.query from. Call it first: it lists the types you can name as a target, the properties you can filter on with the operators each accepts, and the relations you can follow.
Parameters
The user you ask as. The answer covers that user’s documents and client-wide documents, and the customer’s documents too when you also pass
customer_id.The customer you ask as. Without
user_id, the answer covers that customer’s documents and client-wide documents. Not accepted on B2C.context.fetch.
Returns
Where documents came from, each as
{"system": ..., "documents": count}. Only documents with a recorded source appear.How many documents of each document type the scope can see.
The kinds of fact Synap extracts from documents:
Obligation, Commitment, Transaction and Decision. Each has name, the document_types it is extracted from, its properties and its relations (PARTY and COUNTERPARTY).The kinds of entity: the types your instance defines plus the core types. Each has
name, core_type, properties and the relations your instance declares.{"name": ..., "type": ..., "operators": [...]}. type is text, enum, number, date or bool, and an enum also lists its values, for example the statuses of an obligation. operators names the conditions where accepts for that property.
Example
Raises
ContextNotFoundError: when the feature is not enabled on your instance.FeatureNotInPlanError: when your plan does not include knowledge queries.CustomerIdNotAcceptedError: whencustomer_idis passed on a B2C instance.InvalidInputError: whenscopeis not a flat dict of strings.