Skip to main content

Example

View as Markdown

Example object

An example associated with a Knowledge Assistant. Contains a question and guidelines for how the assistant should respond.

namestringBeta

Full resource name: knowledge-assistants/{knowledge_assistant_id}/examples/{example_id}

questionstringBeta

The example question.

guidelinesarray of stringBeta

Guidelines for answering the question. Optional — examples may be created with just a question; the front-end form does not require guidelines.

example_idstringBeta

The universally unique identifier (UUID) of the example.

create_timestringBeta

Timestamp when this example was created.

update_timestringBeta

Timestamp when this example was last updated.

Get Beta

GET /api/2.1/{name=knowledge-assistants/*/examples/*}

Gets an example from a Knowledge Assistant.

API scopes: knowledge-assistants

Parameters

namestringpath

The resource name of the example. Format: knowledge-assistants/{knowledge_assistant_id}/examples/{example_id}

Response

Returns the Example object.

List Beta

GET /api/2.1/{parent=knowledge-assistants/*}/examples

Lists examples under a Knowledge Assistant.

API scopes: knowledge-assistants

Parameters

parentstringpath

Parent resource to list from. Format: knowledge-assistants/{knowledge_assistant_id}

page_sizeint32query

The maximum number of examples to return. If unspecified, at most 100 examples will be returned. The maximum value is 100; values above 100 will be coerced to 100.

Constraints: [ 1 .. 100 ]

page_tokenstringquery

A page token, received from a previous ListExamples call. Provide this to retrieve the subsequent page. If unspecified, the first page will be returned.

Response

Returns a list of Example objects.

Create Beta

POST /api/2.1/{parent=knowledge-assistants/*}/examples

Creates an example for a Knowledge Assistant.

API scopes: knowledge-assistants

Parameters

parentstringpath

Parent resource where this example will be created. Format: knowledge-assistants/{knowledge_assistant_id}

Request body

exampleobject

The example to create under the parent Knowledge Assistant.

Show child attributesHide child attributes
namestring

Full resource name: knowledge-assistants/{knowledge_assistant_id}/examples/{example_id}

questionstring

The example question.

guidelinesarray of string

Guidelines for answering the question. Optional — examples may be created with just a question; the front-end form does not require guidelines.

example_idstring

The universally unique identifier (UUID) of the example.

create_timestring

Timestamp when this example was created.

update_timestring

Timestamp when this example was last updated.

Response

Returns the Example object.

Update Beta

PATCH /api/2.1/{name=knowledge-assistants/*/examples/*}

Updates an example in a Knowledge Assistant.

API scopes: knowledge-assistants

Parameters

namestringpath

The resource name of the example to update. Format: knowledge-assistants/{knowledge_assistant_id}/examples/{example_id}

update_maskstringquery

Comma-delimited list of fields to update on the example. Allowed values: question, guidelines. Examples:

  • question
  • question,guidelines

Request body

exampleobject
Show child attributesHide child attributes
namestring

Full resource name: knowledge-assistants/{knowledge_assistant_id}/examples/{example_id}

questionstring

The example question.

guidelinesarray of string

Guidelines for answering the question. Optional — examples may be created with just a question; the front-end form does not require guidelines.

example_idstring

The universally unique identifier (UUID) of the example.

create_timestring

Timestamp when this example was created.

update_timestring

Timestamp when this example was last updated.

Response

Returns the Example object.

Delete Beta

DELETE /api/2.1/{name=knowledge-assistants/*/examples/*}

Deletes an example from a Knowledge Assistant.

API scopes: knowledge-assistants

Parameters

namestringpath

The resource name of the example to delete. Format: knowledge-assistants/{knowledge_assistant_id}/examples/{example_id}