Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve request example code in api reference for file upload. #302

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion www/docs/rest-api/create-corpus.api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ The new filter attributes of the corpus.

The custom dimensions of all document parts inside the corpus.

</div><li><div style={{"fontSize":"var(--ifm-code-font-size)","opacity":"0.6","marginLeft":"-.5rem","paddingBottom":".5rem"}}>Array [</div></li><SchemaItem collapsible={false} name={"name"} required={true} schemaName={"string"} qualifierMessage={undefined} schema={{"description":"The name of the custom dimension.","type":"string","example":"importance"}}></SchemaItem><SchemaItem collapsible={false} name={"indexing_default"} required={false} schemaName={"double"} qualifierMessage={undefined} schema={{"description":"Default value of a custom dimension on a document part if the custom\ndimension value is not specified when the document part is indexed.\n\nA value of 0 means that custom dimension is not considered.\n","type":"number","format":"double","example":0,"default":0}}></SchemaItem><SchemaItem collapsible={false} name={"querying_default"} required={false} schemaName={"double"} qualifierMessage={undefined} schema={{"description":"Default value of a custom dimension for a query if the value\nof the custom dimension is not specified when querying the corpus.\n\nA value of 0 means that custom dimension is not considered.\n","type":"number","format":"double","example":0,"default":0}}></SchemaItem><li><div style={{"fontSize":"var(--ifm-code-font-size)","opacity":"0.6","marginLeft":"-.5rem"}}>]</div></li></div></details></SchemaItem><SchemaItem collapsible={true} className={"schemaItem"}><details style={{}} className={"openapi-markdown__details"}><summary style={{}}><span className={"openapi-schema__container"}><strong className={"openapi-schema__property"}>limits</strong><span className={"openapi-schema__name"}> object</span></span></summary><div style={{"marginLeft":"1rem"}}><SchemaItem collapsible={false} name={"used_bytes"} required={false} schemaName={"int64"} qualifierMessage={undefined} schema={{"description":"The number of bytes contained in the corpus.","type":"integer","format":"int64"}}></SchemaItem><SchemaItem collapsible={false} name={"max_bytes"} required={false} schemaName={"int64"} qualifierMessage={undefined} schema={{"description":"The maximum number of bytes the corpus can be.","type":"integer","format":"int64"}}></SchemaItem><SchemaItem collapsible={false} name={"max_metadata_bytes"} required={false} schemaName={"int64"} qualifierMessage={undefined} schema={{"description":"The maximum size that metadata can be on documents.","type":"integer","format":"int64"}}></SchemaItem><SchemaItem collapsible={false} name={"index_rate"} required={false} schemaName={"int64"} qualifierMessage={undefined} schema={{"description":"The maximum per-second addition of new documents to corpus.","type":"integer","format":"int64"}}></SchemaItem></div></details></SchemaItem><SchemaItem collapsible={false} name={"created_at"} required={false} schemaName={"date-time"} qualifierMessage={undefined} schema={{"description":"Indicates when the corpus was created.","type":"string","format":"date-time"}}></SchemaItem></ul></details></TabItem><TabItem label={"Example (from schema)"} value={"Example (from schema)"}><ResponseSamples responseExample={"{\n \"id\": \"string\",\n \"key\": \"my-corpus\",\n \"name\": \"string\",\n \"description\": \"string\",\n \"enabled\": true,\n \"chat_history_corpus\": true,\n \"queries_are_answers\": false,\n \"documents_are_questions\": false,\n \"encoder_id\": \"string\",\n \"filter_attributes\": [\n {\n \"name\": \"Title\",\n \"level\": \"document\",\n \"description\": \"The title of the document.\",\n \"indexed\": true,\n \"type\": \"text\"\n }\n ],\n \"custom_dimensions\": [\n {\n \"name\": \"importance\",\n \"indexing_default\": 0,\n \"querying_default\": 0\n }\n ],\n \"limits\": {\n \"used_bytes\": 0,\n \"max_bytes\": 0,\n \"max_metadata_bytes\": 0,\n \"index_rate\": 0\n },\n \"created_at\": \"2024-06-15T13:48:41.274Z\"\n}"} language={"json"}></ResponseSamples></TabItem></SchemaTabs></TabItem></MimeTabs></div></TabItem><TabItem label={"400"} value={"400"}><div>
</div><li><div style={{"fontSize":"var(--ifm-code-font-size)","opacity":"0.6","marginLeft":"-.5rem","paddingBottom":".5rem"}}>Array [</div></li><SchemaItem collapsible={false} name={"name"} required={true} schemaName={"string"} qualifierMessage={undefined} schema={{"description":"The name of the custom dimension.","type":"string","example":"importance"}}></SchemaItem><SchemaItem collapsible={false} name={"indexing_default"} required={false} schemaName={"double"} qualifierMessage={undefined} schema={{"description":"Default value of a custom dimension on a document part if the custom\ndimension value is not specified when the document part is indexed.\n\nA value of 0 means that custom dimension is not considered.\n","type":"number","format":"double","example":0,"default":0}}></SchemaItem><SchemaItem collapsible={false} name={"querying_default"} required={false} schemaName={"double"} qualifierMessage={undefined} schema={{"description":"Default value of a custom dimension for a query if the value\nof the custom dimension is not specified when querying the corpus.\n\nA value of 0 means that custom dimension is not considered.\n","type":"number","format":"double","example":0,"default":0}}></SchemaItem><li><div style={{"fontSize":"var(--ifm-code-font-size)","opacity":"0.6","marginLeft":"-.5rem"}}>]</div></li></div></details></SchemaItem><SchemaItem collapsible={true} className={"schemaItem"}><details style={{}} className={"openapi-markdown__details"}><summary style={{}}><span className={"openapi-schema__container"}><strong className={"openapi-schema__property"}>limits</strong><span className={"openapi-schema__name"}> object</span></span></summary><div style={{"marginLeft":"1rem"}}><SchemaItem collapsible={false} name={"used_bytes"} required={false} schemaName={"int64"} qualifierMessage={undefined} schema={{"description":"The number of bytes contained in the corpus.","type":"integer","format":"int64"}}></SchemaItem><SchemaItem collapsible={false} name={"max_bytes"} required={false} schemaName={"int64"} qualifierMessage={undefined} schema={{"description":"The maximum number of bytes the corpus can be.","type":"integer","format":"int64"}}></SchemaItem><SchemaItem collapsible={false} name={"max_metadata_bytes"} required={false} schemaName={"int64"} qualifierMessage={undefined} schema={{"description":"The maximum size that metadata can be on documents.","type":"integer","format":"int64"}}></SchemaItem><SchemaItem collapsible={false} name={"index_rate"} required={false} schemaName={"int64"} qualifierMessage={undefined} schema={{"description":"The maximum per-second addition of new documents to corpus.","type":"integer","format":"int64"}}></SchemaItem></div></details></SchemaItem><SchemaItem collapsible={false} name={"created_at"} required={false} schemaName={"date-time"} qualifierMessage={undefined} schema={{"description":"Indicates when the corpus was created.","type":"string","format":"date-time"}}></SchemaItem></ul></details></TabItem><TabItem label={"Example (from schema)"} value={"Example (from schema)"}><ResponseSamples responseExample={"{\n \"id\": \"string\",\n \"key\": \"my-corpus\",\n \"name\": \"string\",\n \"description\": \"string\",\n \"enabled\": true,\n \"chat_history_corpus\": true,\n \"queries_are_answers\": false,\n \"documents_are_questions\": false,\n \"encoder_id\": \"string\",\n \"filter_attributes\": [\n {\n \"name\": \"Title\",\n \"level\": \"document\",\n \"description\": \"The title of the document.\",\n \"indexed\": true,\n \"type\": \"text\"\n }\n ],\n \"custom_dimensions\": [\n {\n \"name\": \"importance\",\n \"indexing_default\": 0,\n \"querying_default\": 0\n }\n ],\n \"limits\": {\n \"used_bytes\": 0,\n \"max_bytes\": 0,\n \"max_metadata_bytes\": 0,\n \"index_rate\": 0\n },\n \"created_at\": \"2024-07-03T17:29:41.303Z\"\n}"} language={"json"}></ResponseSamples></TabItem></SchemaTabs></TabItem></MimeTabs></div></TabItem><TabItem label={"400"} value={"400"}><div>

Invalid request body in the create corpus request.

Expand Down
2 changes: 1 addition & 1 deletion www/docs/rest-api/create-user.api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ resource is a resource implied by the request.

string

</div><li><div style={{"fontSize":"var(--ifm-code-font-size)","opacity":"0.6","marginLeft":"-.5rem"}}>]</div></li></div></details></SchemaItem></div></details></SchemaItem></div></details></SchemaItem></div></details></SchemaItem></div></details></SchemaItem></ul></details></TabItem><TabItem label={"Example (from schema)"} value={"Example (from schema)"}><ResponseSamples responseExample={"{\n \"id\": \"string\",\n \"email\": \"user@example.com\",\n \"username\": \"string\",\n \"enabled\": true,\n \"description\": \"string\",\n \"created_at\": \"2024-06-15T13:48:41.304Z\",\n \"updated_at\": \"2024-06-15T13:48:41.304Z\",\n \"api_roles\": [\n \"owner\"\n ],\n \"api_policy\": {\n \"name\": \"string\",\n \"allowed_operations\": {}\n }\n}"} language={"json"}></ResponseSamples></TabItem></SchemaTabs></TabItem></MimeTabs></div></TabItem><TabItem label={"400"} value={"400"}><div>
</div><li><div style={{"fontSize":"var(--ifm-code-font-size)","opacity":"0.6","marginLeft":"-.5rem"}}>]</div></li></div></details></SchemaItem></div></details></SchemaItem></div></details></SchemaItem></div></details></SchemaItem></div></details></SchemaItem></ul></details></TabItem><TabItem label={"Example (from schema)"} value={"Example (from schema)"}><ResponseSamples responseExample={"{\n \"id\": \"string\",\n \"email\": \"user@example.com\",\n \"username\": \"string\",\n \"enabled\": true,\n \"description\": \"string\",\n \"created_at\": \"2024-07-03T17:29:41.340Z\",\n \"updated_at\": \"2024-07-03T17:29:41.340Z\",\n \"api_roles\": [\n \"owner\"\n ],\n \"api_policy\": {\n \"name\": \"string\",\n \"allowed_operations\": {}\n }\n}"} language={"json"}></ResponseSamples></TabItem></SchemaTabs></TabItem></MimeTabs></div></TabItem><TabItem label={"400"} value={"400"}><div>

User creation request was malformed.

Expand Down
2 changes: 1 addition & 1 deletion www/docs/rest-api/get-chat-turn.api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Get a specific turn from a chat, which is a message and response pair from the c

The turn.

</div><div><MimeTabs className={"openapi-tabs__mime"} schemaType={"response"}><TabItem label={"application/json"} value={"application/json"}><SchemaTabs className={"openapi-tabs__schema"}><TabItem label={"Schema"} value={"Schema"}><details style={{}} className={"openapi-markdown__details response"} data-collapsed={false} open={true}><summary style={{}} className={"openapi-markdown__details-summary-response"}><strong>Schema</strong></summary><div style={{"textAlign":"left","marginLeft":"1rem"}}></div><ul style={{"marginLeft":"1rem"}}><SchemaItem collapsible={false} name={"id"} required={false} schemaName={"string"} qualifierMessage={"**Possible values:** Value must match regular expression `trn_.+$`"} schema={{"description":"The ID of the turn.","type":"string","pattern":"trn_.+$"}}></SchemaItem><SchemaItem collapsible={false} name={"chat_id"} required={false} schemaName={"string"} qualifierMessage={"**Possible values:** Value must match regular expression `cht_.+$`"} schema={{"description":"The ID of the chat the turn resides in.","type":"string","pattern":"cht_.+$"}}></SchemaItem><SchemaItem collapsible={false} name={"query"} required={false} schemaName={"string"} qualifierMessage={undefined} schema={{"description":"The query made to produce this turn.","type":"string","example":"How do a turn this widget?"}}></SchemaItem><SchemaItem collapsible={false} name={"answer"} required={false} schemaName={"string"} qualifierMessage={undefined} schema={{"description":"The response to the query.","type":"string","example":"The widget turns counter clockwise."}}></SchemaItem><SchemaItem collapsible={false} name={"enabled"} required={false} schemaName={"boolean"} qualifierMessage={undefined} schema={{"description":"Indicates whether the turn is enabled and shown in futures turns of the chat.","type":"boolean","example":true}}></SchemaItem><SchemaItem collapsible={false} name={"created_at"} required={false} schemaName={"date-time"} qualifierMessage={undefined} schema={{"description":"Specifies when the turn was created.","type":"string","format":"date-time"}}></SchemaItem></ul></details></TabItem><TabItem label={"Example (from schema)"} value={"Example (from schema)"}><ResponseSamples responseExample={"{\n \"id\": \"string\",\n \"chat_id\": \"string\",\n \"query\": \"How do a turn this widget?\",\n \"answer\": \"The widget turns counter clockwise.\",\n \"enabled\": true,\n \"created_at\": \"2024-06-15T13:48:41.300Z\"\n}"} language={"json"}></ResponseSamples></TabItem></SchemaTabs></TabItem></MimeTabs></div></TabItem><TabItem label={"403"} value={"403"}><div>
</div><div><MimeTabs className={"openapi-tabs__mime"} schemaType={"response"}><TabItem label={"application/json"} value={"application/json"}><SchemaTabs className={"openapi-tabs__schema"}><TabItem label={"Schema"} value={"Schema"}><details style={{}} className={"openapi-markdown__details response"} data-collapsed={false} open={true}><summary style={{}} className={"openapi-markdown__details-summary-response"}><strong>Schema</strong></summary><div style={{"textAlign":"left","marginLeft":"1rem"}}></div><ul style={{"marginLeft":"1rem"}}><SchemaItem collapsible={false} name={"id"} required={false} schemaName={"string"} qualifierMessage={"**Possible values:** Value must match regular expression `trn_.+$`"} schema={{"description":"The ID of the turn.","type":"string","pattern":"trn_.+$"}}></SchemaItem><SchemaItem collapsible={false} name={"chat_id"} required={false} schemaName={"string"} qualifierMessage={"**Possible values:** Value must match regular expression `cht_.+$`"} schema={{"description":"The ID of the chat the turn resides in.","type":"string","pattern":"cht_.+$"}}></SchemaItem><SchemaItem collapsible={false} name={"query"} required={false} schemaName={"string"} qualifierMessage={undefined} schema={{"description":"The query made to produce this turn.","type":"string","example":"How do a turn this widget?"}}></SchemaItem><SchemaItem collapsible={false} name={"answer"} required={false} schemaName={"string"} qualifierMessage={undefined} schema={{"description":"The response to the query.","type":"string","example":"The widget turns counter clockwise."}}></SchemaItem><SchemaItem collapsible={false} name={"enabled"} required={false} schemaName={"boolean"} qualifierMessage={undefined} schema={{"description":"Indicates whether the turn is enabled and shown in futures turns of the chat.","type":"boolean","example":true}}></SchemaItem><SchemaItem collapsible={false} name={"created_at"} required={false} schemaName={"date-time"} qualifierMessage={undefined} schema={{"description":"Specifies when the turn was created.","type":"string","format":"date-time"}}></SchemaItem></ul></details></TabItem><TabItem label={"Example (from schema)"} value={"Example (from schema)"}><ResponseSamples responseExample={"{\n \"id\": \"string\",\n \"chat_id\": \"string\",\n \"query\": \"How do a turn this widget?\",\n \"answer\": \"The widget turns counter clockwise.\",\n \"enabled\": true,\n \"created_at\": \"2024-07-03T17:29:41.333Z\"\n}"} language={"json"}></ResponseSamples></TabItem></SchemaTabs></TabItem></MimeTabs></div></TabItem><TabItem label={"403"} value={"403"}><div>

Permissions do not allow getting the turn.

Expand Down
2 changes: 1 addition & 1 deletion www/docs/rest-api/get-chat.api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Get a chat summary to view what started the chat, but not subsequent turns.

A chat.

</div><div><MimeTabs className={"openapi-tabs__mime"} schemaType={"response"}><TabItem label={"application/json"} value={"application/json"}><SchemaTabs className={"openapi-tabs__schema"}><TabItem label={"Schema"} value={"Schema"}><details style={{}} className={"openapi-markdown__details response"} data-collapsed={false} open={true}><summary style={{}} className={"openapi-markdown__details-summary-response"}><strong>Schema</strong></summary><div style={{"textAlign":"left","marginLeft":"1rem"}}></div><ul style={{"marginLeft":"1rem"}}><SchemaItem collapsible={false} name={"id"} required={false} schemaName={"string"} qualifierMessage={"**Possible values:** Value must match regular expression `cht_.+$`"} schema={{"description":"ID of the chat.","type":"string","pattern":"cht_.+$"}}></SchemaItem><SchemaItem collapsible={false} name={"first_query"} required={false} schemaName={"string"} qualifierMessage={undefined} schema={{"description":"The first query of the chat.","type":"string"}}></SchemaItem><SchemaItem collapsible={false} name={"first_answer"} required={false} schemaName={"string"} qualifierMessage={undefined} schema={{"description":"The first answer of the chat.","type":"string"}}></SchemaItem><SchemaItem collapsible={false} name={"enabled"} required={false} schemaName={"boolean"} qualifierMessage={undefined} schema={{"description":"Indicates whether this chat is enabled and can have further turns.","type":"boolean","example":true}}></SchemaItem><SchemaItem collapsible={false} name={"created_at"} required={false} schemaName={"date-time"} qualifierMessage={undefined} schema={{"description":"Specifies when this chat was created.","type":"string","format":"date-time"}}></SchemaItem></ul></details></TabItem><TabItem label={"Example (from schema)"} value={"Example (from schema)"}><ResponseSamples responseExample={"{\n \"id\": \"string\",\n \"first_query\": \"string\",\n \"first_answer\": \"string\",\n \"enabled\": true,\n \"created_at\": \"2024-06-15T13:48:41.295Z\"\n}"} language={"json"}></ResponseSamples></TabItem></SchemaTabs></TabItem></MimeTabs></div></TabItem><TabItem label={"403"} value={"403"}><div>
</div><div><MimeTabs className={"openapi-tabs__mime"} schemaType={"response"}><TabItem label={"application/json"} value={"application/json"}><SchemaTabs className={"openapi-tabs__schema"}><TabItem label={"Schema"} value={"Schema"}><details style={{}} className={"openapi-markdown__details response"} data-collapsed={false} open={true}><summary style={{}} className={"openapi-markdown__details-summary-response"}><strong>Schema</strong></summary><div style={{"textAlign":"left","marginLeft":"1rem"}}></div><ul style={{"marginLeft":"1rem"}}><SchemaItem collapsible={false} name={"id"} required={false} schemaName={"string"} qualifierMessage={"**Possible values:** Value must match regular expression `cht_.+$`"} schema={{"description":"ID of the chat.","type":"string","pattern":"cht_.+$"}}></SchemaItem><SchemaItem collapsible={false} name={"first_query"} required={false} schemaName={"string"} qualifierMessage={undefined} schema={{"description":"The first query of the chat.","type":"string"}}></SchemaItem><SchemaItem collapsible={false} name={"first_answer"} required={false} schemaName={"string"} qualifierMessage={undefined} schema={{"description":"The first answer of the chat.","type":"string"}}></SchemaItem><SchemaItem collapsible={false} name={"enabled"} required={false} schemaName={"boolean"} qualifierMessage={undefined} schema={{"description":"Indicates whether this chat is enabled and can have further turns.","type":"boolean","example":true}}></SchemaItem><SchemaItem collapsible={false} name={"created_at"} required={false} schemaName={"date-time"} qualifierMessage={undefined} schema={{"description":"Specifies when this chat was created.","type":"string","format":"date-time"}}></SchemaItem></ul></details></TabItem><TabItem label={"Example (from schema)"} value={"Example (from schema)"}><ResponseSamples responseExample={"{\n \"id\": \"string\",\n \"first_query\": \"string\",\n \"first_answer\": \"string\",\n \"enabled\": true,\n \"created_at\": \"2024-07-03T17:29:41.328Z\"\n}"} language={"json"}></ResponseSamples></TabItem></SchemaTabs></TabItem></MimeTabs></div></TabItem><TabItem label={"403"} value={"403"}><div>

Permissions do not allow retrieving the chat.

Expand Down
Loading
Loading