From 89354b3e7d9571ea609cfb9a347f28b632c1f760 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Tue, 17 Sep 2024 19:33:09 +0000 Subject: [PATCH] ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.398.1 --- .speakeasy/gen.lock | 33 +++++-- .speakeasy/gen.yaml | 2 +- .speakeasy/workflow.lock | 12 +-- README.md | 8 +- RELEASES.md | 12 ++- codeSamples.yaml | 8 +- docs/models/components/querybody.md | 19 ++++ docs/models/operations/queryrequest.md | 22 +++++ docs/models/operations/queryresponsebody.md | 14 +++ ...agcontrollerqueryembeddingsresponsebody.md | 14 --- docs/sdks/connections/README.md | 10 +- docs/sdks/query/README.md | 27 ++++-- jsr.json | 2 +- package-lock.json | 4 +- package.json | 2 +- ...nectionsRetrieve.ts => connectionsList.ts} | 4 +- ...lerQueryEmbeddings.ts => ragQueryQuery.ts} | 45 +++++++-- src/lib/config.ts | 6 +- src/models/components/index.ts | 1 + src/models/components/querybody.ts | 55 +++++++++++ src/models/operations/index.ts | 2 +- src/models/operations/query.ts | 96 +++++++++++++++++++ .../ragcontrollerqueryembeddings.ts | 39 -------- src/sdk/connections.ts | 6 +- src/sdk/query.ts | 16 +++- 25 files changed, 345 insertions(+), 114 deletions(-) create mode 100644 docs/models/components/querybody.md create mode 100644 docs/models/operations/queryrequest.md create mode 100644 docs/models/operations/queryresponsebody.md delete mode 100644 docs/models/operations/ragcontrollerqueryembeddingsresponsebody.md rename src/funcs/{connectionsRetrieve.ts => connectionsList.ts} (96%) rename src/funcs/{ragQueryRagControllerQueryEmbeddings.ts => ragQueryQuery.ts} (69%) create mode 100644 src/models/components/querybody.ts create mode 100644 src/models/operations/query.ts delete mode 100644 src/models/operations/ragcontrollerqueryembeddings.ts diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index c249419..6c7314a 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: caaaa8c3-6dd7-43a5-841e-c3193e68cc73 management: - docChecksum: 4451647c3fecd12e75576c88d6e46844 + docChecksum: ef657b2aadcc7b6b8d116b9b11322b80 docVersion: "1.0" - speakeasyVersion: 1.396.9 - generationVersion: 2.415.7 - releaseVersion: 0.13.1 - configChecksum: 5881ae6eaf79ded36c0abecd2d47bd0c + speakeasyVersion: 1.398.1 + generationVersion: 2.415.8 + releaseVersion: 0.13.2 + configChecksum: 594e8b0951a87c6de2ba2291352d7ff3 repoURL: https://github.com/panoratech/typescript-sdk.git installationURL: https://github.com/panoratech/typescript-sdk published: true @@ -77,6 +77,7 @@ generatedFiles: - docs/models/components/passthroughrequestdtomethod.md - docs/models/components/phone.md - docs/models/components/projectresponse.md + - docs/models/components/querybody.md - docs/models/components/remotedata.md - docs/models/components/requestformat.md - docs/models/components/resyncstatusdto.md @@ -613,7 +614,8 @@ generatedFiles: - docs/models/operations/listticketingusersrequest.md - docs/models/operations/listticketingusersresponse.md - docs/models/operations/listticketingusersresponsebody.md - - docs/models/operations/ragcontrollerqueryembeddingsresponsebody.md + - docs/models/operations/queryrequest.md + - docs/models/operations/queryresponsebody.md - docs/models/operations/remoteidrequest.md - docs/models/operations/requestpassthroughresponsebody.md - docs/models/operations/requestrequest.md @@ -905,7 +907,7 @@ generatedFiles: - src/funcs/atsUsersList.ts - src/funcs/atsUsersRetrieve.ts - src/funcs/authLoginSignIn.ts - - src/funcs/connectionsRetrieve.ts + - src/funcs/connectionsList.ts - src/funcs/crmCompaniesCreate.ts - src/funcs/crmCompaniesList.ts - src/funcs/crmCompaniesRetrieve.ts @@ -1025,7 +1027,7 @@ generatedFiles: - src/funcs/passthroughRetryidGetRetriedRequestResponse.ts - src/funcs/projectsCreate.ts - src/funcs/projectsGetProjects.ts - - src/funcs/ragQueryRagControllerQueryEmbeddings.ts + - src/funcs/ragQueryQuery.ts - src/funcs/syncGetPullFrequency.ts - src/funcs/syncResync.ts - src/funcs/syncStatus.ts @@ -1095,6 +1097,7 @@ generatedFiles: - src/models/components/passthroughrequestdto.ts - src/models/components/phone.ts - src/models/components/projectresponse.ts + - src/models/components/querybody.ts - src/models/components/resyncstatusdto.ts - src/models/components/security.ts - src/models/components/signatureverificationdto.ts @@ -1352,7 +1355,7 @@ generatedFiles: - src/models/operations/listticketingteams.ts - src/models/operations/listticketingticket.ts - src/models/operations/listticketingusers.ts - - src/models/operations/ragcontrollerqueryembeddings.ts + - src/models/operations/query.ts - src/models/operations/remoteid.ts - src/models/operations/request.ts - src/models/operations/retrieveaccountingaccount.ts @@ -4116,3 +4119,15 @@ examples: responses: "200": application/json: [] + query: + speakeasy-default-query: + parameters: + header: + x-connection-token: "" + requestBody: + application/json: {"query": "When does Panora incorporated?", "topK": "3"} + listConnections: + speakeasy-default-list-connections: + responses: + "200": + application/json: [] diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index ee87b3a..2718dd2 100755 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -12,7 +12,7 @@ generation: auth: oAuth2ClientCredentialsEnabled: false typescript: - version: 0.13.1 + version: 0.13.2 additionalDependencies: dependencies: {} devDependencies: {} diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 88bcf2c..e0df459 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,9 +1,9 @@ -speakeasyVersion: 1.396.9 +speakeasyVersion: 1.398.1 sources: panora-open-api-swagger: sourceNamespace: panora-open-api-swagger - sourceRevisionDigest: sha256:09a41c636f335cafb4d85225a9fdcc98b18cc03fc47615252db414011724c867 - sourceBlobDigest: sha256:713f0a4faf73742f535cfe53b021385e24d65199df45d99217e68df12be7c42b + sourceRevisionDigest: sha256:e982bbcb51be9c21a9c5df52739d32ffd37c8ba27fee825a4ede576d2098b124 + sourceBlobDigest: sha256:11ed4be0d33ec3cc2c4c95a2b21ab2e1732bcb9e9760872be99cfaa3ca2b1279 tags: - latest - main @@ -11,10 +11,10 @@ targets: my-first-target: source: panora-open-api-swagger sourceNamespace: panora-open-api-swagger - sourceRevisionDigest: sha256:09a41c636f335cafb4d85225a9fdcc98b18cc03fc47615252db414011724c867 - sourceBlobDigest: sha256:713f0a4faf73742f535cfe53b021385e24d65199df45d99217e68df12be7c42b + sourceRevisionDigest: sha256:e982bbcb51be9c21a9c5df52739d32ffd37c8ba27fee825a4ede576d2098b124 + sourceBlobDigest: sha256:11ed4be0d33ec3cc2c4c95a2b21ab2e1732bcb9e9760872be99cfaa3ca2b1279 codeSamplesNamespace: code-samples-typescript-my-first-target - codeSamplesRevisionDigest: sha256:030a224e95feecb4deaf3a55f955f41b15b2be46da8a1c58ba2c97ae63162434 + codeSamplesRevisionDigest: sha256:eaf6fe560f15e64bc026cb4515d0ba1760afefd570081ed701cd310628679f64 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index 3615975..a929544 100644 --- a/README.md +++ b/README.md @@ -311,7 +311,7 @@ run(); ### [connections](docs/sdks/connections/README.md) -* [retrieve](docs/sdks/connections/README.md#retrieve) - List Connections +* [list](docs/sdks/connections/README.md#list) - List Connections ### [crm](docs/sdks/crm/README.md) @@ -596,7 +596,7 @@ run(); #### [rag.query](docs/sdks/query/README.md) -* [ragControllerQueryEmbeddings](docs/sdks/query/README.md#ragcontrollerqueryembeddings) +* [query](docs/sdks/query/README.md#query) - Query using RAG Search ### [sync](docs/sdks/sync/README.md) @@ -1054,7 +1054,7 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md). - [atsUsersList](docs/sdks/panoraatsusers/README.md#list) - [atsUsersRetrieve](docs/sdks/panoraatsusers/README.md#retrieve) - [authLoginSignIn](docs/sdks/login/README.md#signin) -- [connectionsRetrieve](docs/sdks/connections/README.md#retrieve) +- [connectionsList](docs/sdks/connections/README.md#list) - [crmCompaniesCreate](docs/sdks/companies/README.md#create) - [crmCompaniesList](docs/sdks/companies/README.md#list) - [crmCompaniesRetrieve](docs/sdks/companies/README.md#retrieve) @@ -1174,7 +1174,7 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md). - [passthroughRetryidGetRetriedRequestResponse](docs/sdks/retryid/README.md#getretriedrequestresponse) - [projectsCreate](docs/sdks/projects/README.md#create) - [projectsGetProjects](docs/sdks/projects/README.md#getprojects) -- [ragQueryRagControllerQueryEmbeddings](docs/sdks/query/README.md#ragcontrollerqueryembeddings) +- [ragQueryQuery](docs/sdks/query/README.md#query) - [syncGetPullFrequency](docs/sdks/sync/README.md#getpullfrequency) - [syncResync](docs/sdks/sync/README.md#resync) - [syncStatus](docs/sdks/sync/README.md#status) diff --git a/RELEASES.md b/RELEASES.md index c0bd253..0f1b8ec 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -248,4 +248,14 @@ Based on: ### Generated - [typescript v0.13.1] . ### Releases -- [NPM v0.13.1] https://www.npmjs.com/package/@panora/sdk/v/0.13.1 - . \ No newline at end of file +- [NPM v0.13.1] https://www.npmjs.com/package/@panora/sdk/v/0.13.1 - . + +## 2024-09-17 19:29:15 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.398.1 (2.415.8) https://github.com/speakeasy-api/speakeasy +### Generated +- [typescript v0.13.2] . +### Releases +- [NPM v0.13.2] https://www.npmjs.com/package/@panora/sdk/v/0.13.2 - . \ No newline at end of file diff --git a/codeSamples.yaml b/codeSamples.yaml index e9f3b3f..3e6fbe6 100644 --- a/codeSamples.yaml +++ b/codeSamples.yaml @@ -531,8 +531,8 @@ actions: update: x-codeSamples: - lang: typescript - label: retrieveConnections - source: "import { Panora } from \"@panora/sdk\";\n\nconst panora = new Panora({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await panora.connections.retrieve();\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + label: listConnections + source: "import { Panora } from \"@panora/sdk\";\n\nconst panora = new Panora({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await panora.connections.list();\n \n // Handle the result\n console.log(result)\n}\n\nrun();" - target: $["paths"]["/crm/companies"]["get"] update: x-codeSamples: @@ -1291,8 +1291,8 @@ actions: update: x-codeSamples: - lang: typescript - label: RagController_queryEmbeddings - source: "import { Panora } from \"@panora/sdk\";\n\nconst panora = new Panora({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await panora.rag.query.ragControllerQueryEmbeddings();\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + label: query + source: "import { Panora } from \"@panora/sdk\";\n\nconst panora = new Panora({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await panora.rag.query.query({\n xConnectionToken: \"\",\n queryBody: {\n query: \"When does Panora incorporated?\",\n topK: 3,\n },\n });\n \n // Handle the result\n console.log(result)\n}\n\nrun();" - target: $["paths"]["/sync/pull-frequencies"]["get"] update: x-codeSamples: diff --git a/docs/models/components/querybody.md b/docs/models/components/querybody.md new file mode 100644 index 0000000..6ff79b5 --- /dev/null +++ b/docs/models/components/querybody.md @@ -0,0 +1,19 @@ +# QueryBody + +## Example Usage + +```typescript +import { QueryBody } from "@panora/sdk/models/components"; + +let value: QueryBody = { + query: "When does Panora incorporated?", + topK: 3, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `query` | *string* | :heavy_check_mark: | The query you want to received embeddings adn chunks for | When does Panora incorporated? | +| `topK` | *number* | :heavy_minus_sign: | The number of most appropriate documents for your query. | 3 | \ No newline at end of file diff --git a/docs/models/operations/queryrequest.md b/docs/models/operations/queryrequest.md new file mode 100644 index 0000000..0ffdf74 --- /dev/null +++ b/docs/models/operations/queryrequest.md @@ -0,0 +1,22 @@ +# QueryRequest + +## Example Usage + +```typescript +import { QueryRequest } from "@panora/sdk/models/operations"; + +let value: QueryRequest = { + xConnectionToken: "", + queryBody: { + query: "When does Panora incorporated?", + topK: 3, + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `xConnectionToken` | *string* | :heavy_check_mark: | The connection token | +| `queryBody` | [components.QueryBody](../../models/components/querybody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/queryresponsebody.md b/docs/models/operations/queryresponsebody.md new file mode 100644 index 0000000..e2519a5 --- /dev/null +++ b/docs/models/operations/queryresponsebody.md @@ -0,0 +1,14 @@ +# QueryResponseBody + +## Example Usage + +```typescript +import { QueryResponseBody } from "@panora/sdk/models/operations"; + +let value: QueryResponseBody = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/operations/ragcontrollerqueryembeddingsresponsebody.md b/docs/models/operations/ragcontrollerqueryembeddingsresponsebody.md deleted file mode 100644 index 12e4fbe..0000000 --- a/docs/models/operations/ragcontrollerqueryembeddingsresponsebody.md +++ /dev/null @@ -1,14 +0,0 @@ -# RagControllerQueryEmbeddingsResponseBody - -## Example Usage - -```typescript -import { RagControllerQueryEmbeddingsResponseBody } from "@panora/sdk/models/operations"; - -let value: RagControllerQueryEmbeddingsResponseBody = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/sdks/connections/README.md b/docs/sdks/connections/README.md index c9bc026..5504e99 100644 --- a/docs/sdks/connections/README.md +++ b/docs/sdks/connections/README.md @@ -5,9 +5,9 @@ ### Available Operations -* [retrieve](#retrieve) - List Connections +* [list](#list) - List Connections -## retrieve +## list List Connections @@ -21,7 +21,7 @@ const panora = new Panora({ }); async function run() { - const result = await panora.connections.retrieve(); + const result = await panora.connections.list(); // Handle the result console.log(result) @@ -36,7 +36,7 @@ The standalone function version of this method: ```typescript import { PanoraCore } from "@panora/sdk/core.js"; -import { connectionsRetrieve } from "@panora/sdk/funcs/connectionsRetrieve.js"; +import { connectionsList } from "@panora/sdk/funcs/connectionsList.js"; // Use `PanoraCore` for best tree-shaking performance. // You can create one instance of it to use across an application. @@ -45,7 +45,7 @@ const panora = new PanoraCore({ }); async function run() { - const res = await connectionsRetrieve(panora); + const res = await connectionsList(panora); if (!res.ok) { throw res.error; diff --git a/docs/sdks/query/README.md b/docs/sdks/query/README.md index cfa75e2..9558a12 100644 --- a/docs/sdks/query/README.md +++ b/docs/sdks/query/README.md @@ -5,9 +5,11 @@ ### Available Operations -* [ragControllerQueryEmbeddings](#ragcontrollerqueryembeddings) +* [query](#query) - Query using RAG Search -## ragControllerQueryEmbeddings +## query + +Query across your connected data sources using RAG Search ### Example Usage @@ -19,7 +21,13 @@ const panora = new Panora({ }); async function run() { - const result = await panora.rag.query.ragControllerQueryEmbeddings(); + const result = await panora.rag.query.query({ + xConnectionToken: "", + queryBody: { + query: "When does Panora incorporated?", + topK: 3, + }, + }); // Handle the result console.log(result) @@ -34,7 +42,7 @@ The standalone function version of this method: ```typescript import { PanoraCore } from "@panora/sdk/core.js"; -import { ragQueryRagControllerQueryEmbeddings } from "@panora/sdk/funcs/ragQueryRagControllerQueryEmbeddings.js"; +import { ragQueryQuery } from "@panora/sdk/funcs/ragQueryQuery.js"; // Use `PanoraCore` for best tree-shaking performance. // You can create one instance of it to use across an application. @@ -43,7 +51,13 @@ const panora = new PanoraCore({ }); async function run() { - const res = await ragQueryRagControllerQueryEmbeddings(panora); + const res = await ragQueryQuery(panora, { + xConnectionToken: "", + queryBody: { + query: "When does Panora incorporated?", + topK: 3, + }, + }); if (!res.ok) { throw res.error; @@ -62,13 +76,14 @@ run(); | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.QueryRequest](../../models/operations/queryrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise\<[operations.RagControllerQueryEmbeddingsResponseBody](../../models/operations/ragcontrollerqueryembeddingsresponsebody.md)\>** +**Promise\<[operations.QueryResponseBody](../../models/operations/queryresponsebody.md)\>** ### Errors diff --git a/jsr.json b/jsr.json index 1e71f1d..55bf4fc 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "@panora/sdk", - "version": "0.13.1", + "version": "0.13.2", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/package-lock.json b/package-lock.json index 3a70f66..99e7727 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@panora/sdk", - "version": "0.13.1", + "version": "0.13.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@panora/sdk", - "version": "0.13.1", + "version": "0.13.2", "devDependencies": { "@typescript-eslint/eslint-plugin": "^7.7.1", "@typescript-eslint/parser": "^7.7.1", diff --git a/package.json b/package.json index b9daf37..6f05300 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@panora/sdk", - "version": "0.13.1", + "version": "0.13.2", "author": "Speakeasy", "main": "./index.js", "sideEffects": false, diff --git a/src/funcs/connectionsRetrieve.ts b/src/funcs/connectionsList.ts similarity index 96% rename from src/funcs/connectionsRetrieve.ts rename to src/funcs/connectionsList.ts index 3e83165..989d909 100644 --- a/src/funcs/connectionsRetrieve.ts +++ b/src/funcs/connectionsList.ts @@ -23,7 +23,7 @@ import { Result } from "../types/fp.js"; /** * List Connections */ -export async function connectionsRetrieve( +export async function connectionsList( client$: PanoraCore, options?: RequestOptions, ): Promise< @@ -47,7 +47,7 @@ export async function connectionsRetrieve( const apiKey$ = await extractSecurity(client$.options$.apiKey); const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; const context = { - operationID: "retrieveConnections", + operationID: "listConnections", oAuth2Scopes: [], securitySource: client$.options$.apiKey, }; diff --git a/src/funcs/ragQueryRagControllerQueryEmbeddings.ts b/src/funcs/ragQueryQuery.ts similarity index 69% rename from src/funcs/ragQueryRagControllerQueryEmbeddings.ts rename to src/funcs/ragQueryQuery.ts index 76032f3..4de41f7 100644 --- a/src/funcs/ragQueryRagControllerQueryEmbeddings.ts +++ b/src/funcs/ragQueryQuery.ts @@ -3,7 +3,12 @@ */ import { PanoraCore } from "../core.js"; +import { + encodeJSON as encodeJSON$, + encodeSimple as encodeSimple$, +} from "../lib/encodings.js"; import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; import { RequestOptions } from "../lib/sdks.js"; import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; import { pathToFunc } from "../lib/url.js"; @@ -19,12 +24,19 @@ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; import * as operations from "../models/operations/index.js"; import { Result } from "../types/fp.js"; -export async function ragQueryRagControllerQueryEmbeddings( +/** + * Query using RAG Search + * + * @remarks + * Query across your connected data sources using RAG Search + */ +export async function ragQueryQuery( client$: PanoraCore, + request: operations.QueryRequest, options?: RequestOptions, ): Promise< Result< - operations.RagControllerQueryEmbeddingsResponseBody, + operations.QueryResponseBody, | SDKError | SDKValidationError | UnexpectedClientError @@ -34,16 +46,35 @@ export async function ragQueryRagControllerQueryEmbeddings( | ConnectionError > > { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.QueryRequest$outboundSchema.parse(value$), + "Input validation failed", + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$.QueryBody, { explode: true }); + const path$ = pathToFunc("/rag/query")(); const headers$ = new Headers({ + "Content-Type": "application/json", Accept: "application/json", + "x-connection-token": encodeSimple$( + "x-connection-token", + payload$["x-connection-token"], + { explode: false, charEncoding: "none" }, + ), }); const apiKey$ = await extractSecurity(client$.options$.apiKey); const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; const context = { - operationID: "RagController_queryEmbeddings", + operationID: "query", oAuth2Scopes: [], securitySource: client$.options$.apiKey, }; @@ -54,6 +85,7 @@ export async function ragQueryRagControllerQueryEmbeddings( method: "POST", path: path$, headers: headers$, + body: body$, timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, }, options); if (!requestRes.ok) { @@ -74,7 +106,7 @@ export async function ragQueryRagControllerQueryEmbeddings( const response = doResult.value; const [result$] = await m$.match< - operations.RagControllerQueryEmbeddingsResponseBody, + operations.QueryResponseBody, | SDKError | SDKValidationError | UnexpectedClientError @@ -83,10 +115,7 @@ export async function ragQueryRagControllerQueryEmbeddings( | RequestTimeoutError | ConnectionError >( - m$.json( - 201, - operations.RagControllerQueryEmbeddingsResponseBody$inboundSchema, - ), + m$.json(201, operations.QueryResponseBody$inboundSchema), m$.fail(["4XX", "5XX"]), )(response); if (!result$.ok) { diff --git a/src/lib/config.ts b/src/lib/config.ts index d66e020..89c3d36 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -65,7 +65,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", openapiDocVersion: "1.0", - sdkVersion: "0.13.1", - genVersion: "2.415.7", - userAgent: "speakeasy-sdk/typescript 0.13.1 2.415.7 1.0 @panora/sdk", + sdkVersion: "0.13.2", + genVersion: "2.415.8", + userAgent: "speakeasy-sdk/typescript 0.13.2 2.415.8 1.0 @panora/sdk", } as const; diff --git a/src/models/components/index.ts b/src/models/components/index.ts index 73d4f0b..ee5c22d 100644 --- a/src/models/components/index.ts +++ b/src/models/components/index.ts @@ -21,6 +21,7 @@ export * from "./mapfieldtoproviderdto.js"; export * from "./passthroughrequestdto.js"; export * from "./phone.js"; export * from "./projectresponse.js"; +export * from "./querybody.js"; export * from "./resyncstatusdto.js"; export * from "./security.js"; export * from "./signatureverificationdto.js"; diff --git a/src/models/components/querybody.ts b/src/models/components/querybody.ts new file mode 100644 index 0000000..b1c49fe --- /dev/null +++ b/src/models/components/querybody.ts @@ -0,0 +1,55 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; + +export type QueryBody = { + /** + * The query you want to received embeddings adn chunks for + */ + query: string; + /** + * The number of most appropriate documents for your query. + */ + topK?: number | null | undefined; +}; + +/** @internal */ +export const QueryBody$inboundSchema: z.ZodType< + QueryBody, + z.ZodTypeDef, + unknown +> = z.object({ + query: z.string(), + topK: z.nullable(z.number()).optional(), +}); + +/** @internal */ +export type QueryBody$Outbound = { + query: string; + topK?: number | null | undefined; +}; + +/** @internal */ +export const QueryBody$outboundSchema: z.ZodType< + QueryBody$Outbound, + z.ZodTypeDef, + QueryBody +> = z.object({ + query: z.string(), + topK: z.nullable(z.number()).optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace QueryBody$ { + /** @deprecated use `QueryBody$inboundSchema` instead. */ + export const inboundSchema = QueryBody$inboundSchema; + /** @deprecated use `QueryBody$outboundSchema` instead. */ + export const outboundSchema = QueryBody$outboundSchema; + /** @deprecated use `QueryBody$Outbound` instead. */ + export type Outbound = QueryBody$Outbound; +} diff --git a/src/models/operations/index.ts b/src/models/operations/index.ts index 505169f..031e371 100644 --- a/src/models/operations/index.ts +++ b/src/models/operations/index.ts @@ -125,7 +125,7 @@ export * from "./listticketingtags.js"; export * from "./listticketingteams.js"; export * from "./listticketingticket.js"; export * from "./listticketingusers.js"; -export * from "./ragcontrollerqueryembeddings.js"; +export * from "./query.js"; export * from "./remoteid.js"; export * from "./request.js"; export * from "./retrieveaccountingaccount.js"; diff --git a/src/models/operations/query.ts b/src/models/operations/query.ts new file mode 100644 index 0000000..bf5183b --- /dev/null +++ b/src/models/operations/query.ts @@ -0,0 +1,96 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import * as components from "../components/index.js"; + +export type QueryRequest = { + /** + * The connection token + */ + xConnectionToken: string; + queryBody: components.QueryBody; +}; + +export type QueryResponseBody = {}; + +/** @internal */ +export const QueryRequest$inboundSchema: z.ZodType< + QueryRequest, + z.ZodTypeDef, + unknown +> = z.object({ + "x-connection-token": z.string(), + QueryBody: components.QueryBody$inboundSchema, +}).transform((v) => { + return remap$(v, { + "x-connection-token": "xConnectionToken", + "QueryBody": "queryBody", + }); +}); + +/** @internal */ +export type QueryRequest$Outbound = { + "x-connection-token": string; + QueryBody: components.QueryBody$Outbound; +}; + +/** @internal */ +export const QueryRequest$outboundSchema: z.ZodType< + QueryRequest$Outbound, + z.ZodTypeDef, + QueryRequest +> = z.object({ + xConnectionToken: z.string(), + queryBody: components.QueryBody$outboundSchema, +}).transform((v) => { + return remap$(v, { + xConnectionToken: "x-connection-token", + queryBody: "QueryBody", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace QueryRequest$ { + /** @deprecated use `QueryRequest$inboundSchema` instead. */ + export const inboundSchema = QueryRequest$inboundSchema; + /** @deprecated use `QueryRequest$outboundSchema` instead. */ + export const outboundSchema = QueryRequest$outboundSchema; + /** @deprecated use `QueryRequest$Outbound` instead. */ + export type Outbound = QueryRequest$Outbound; +} + +/** @internal */ +export const QueryResponseBody$inboundSchema: z.ZodType< + QueryResponseBody, + z.ZodTypeDef, + unknown +> = z.object({}); + +/** @internal */ +export type QueryResponseBody$Outbound = {}; + +/** @internal */ +export const QueryResponseBody$outboundSchema: z.ZodType< + QueryResponseBody$Outbound, + z.ZodTypeDef, + QueryResponseBody +> = z.object({}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace QueryResponseBody$ { + /** @deprecated use `QueryResponseBody$inboundSchema` instead. */ + export const inboundSchema = QueryResponseBody$inboundSchema; + /** @deprecated use `QueryResponseBody$outboundSchema` instead. */ + export const outboundSchema = QueryResponseBody$outboundSchema; + /** @deprecated use `QueryResponseBody$Outbound` instead. */ + export type Outbound = QueryResponseBody$Outbound; +} diff --git a/src/models/operations/ragcontrollerqueryembeddings.ts b/src/models/operations/ragcontrollerqueryembeddings.ts deleted file mode 100644 index a4d608c..0000000 --- a/src/models/operations/ragcontrollerqueryembeddings.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; - -export type RagControllerQueryEmbeddingsResponseBody = {}; - -/** @internal */ -export const RagControllerQueryEmbeddingsResponseBody$inboundSchema: z.ZodType< - RagControllerQueryEmbeddingsResponseBody, - z.ZodTypeDef, - unknown -> = z.object({}); - -/** @internal */ -export type RagControllerQueryEmbeddingsResponseBody$Outbound = {}; - -/** @internal */ -export const RagControllerQueryEmbeddingsResponseBody$outboundSchema: z.ZodType< - RagControllerQueryEmbeddingsResponseBody$Outbound, - z.ZodTypeDef, - RagControllerQueryEmbeddingsResponseBody -> = z.object({}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace RagControllerQueryEmbeddingsResponseBody$ { - /** @deprecated use `RagControllerQueryEmbeddingsResponseBody$inboundSchema` instead. */ - export const inboundSchema = - RagControllerQueryEmbeddingsResponseBody$inboundSchema; - /** @deprecated use `RagControllerQueryEmbeddingsResponseBody$outboundSchema` instead. */ - export const outboundSchema = - RagControllerQueryEmbeddingsResponseBody$outboundSchema; - /** @deprecated use `RagControllerQueryEmbeddingsResponseBody$Outbound` instead. */ - export type Outbound = RagControllerQueryEmbeddingsResponseBody$Outbound; -} diff --git a/src/sdk/connections.ts b/src/sdk/connections.ts index 2176c27..84bc268 100644 --- a/src/sdk/connections.ts +++ b/src/sdk/connections.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { connectionsRetrieve } from "../funcs/connectionsRetrieve.js"; +import { connectionsList } from "../funcs/connectionsList.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; import { unwrapAsync } from "../types/fp.js"; @@ -11,10 +11,10 @@ export class Connections extends ClientSDK { /** * List Connections */ - async retrieve( + async list( options?: RequestOptions, ): Promise> { - return unwrapAsync(connectionsRetrieve( + return unwrapAsync(connectionsList( this, options, )); diff --git a/src/sdk/query.ts b/src/sdk/query.ts index fda2605..61e9014 100644 --- a/src/sdk/query.ts +++ b/src/sdk/query.ts @@ -2,17 +2,25 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { ragQueryRagControllerQueryEmbeddings } from "../funcs/ragQueryRagControllerQueryEmbeddings.js"; +import { ragQueryQuery } from "../funcs/ragQueryQuery.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as operations from "../models/operations/index.js"; import { unwrapAsync } from "../types/fp.js"; export class Query extends ClientSDK { - async ragControllerQueryEmbeddings( + /** + * Query using RAG Search + * + * @remarks + * Query across your connected data sources using RAG Search + */ + async query( + request: operations.QueryRequest, options?: RequestOptions, - ): Promise { - return unwrapAsync(ragQueryRagControllerQueryEmbeddings( + ): Promise { + return unwrapAsync(ragQueryQuery( this, + request, options, )); }