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

chore: Regenerate grounding clients with a default base path #393

Merged
merged 11 commits into from
Jan 3, 2025
5 changes: 3 additions & 2 deletions packages/core/src/openapi-request-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ export class OpenApiRequestBuilder<
constructor(
method: Method,
pathPattern: string,
parameters?: OpenApiRequestParameters
parameters?: OpenApiRequestParameters,
basePath?: string
) {
super(method, pathPattern, parameters);
super(method, pathPattern, parameters, basePath);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/document-grounding/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"test": "NODE_OPTIONS=--experimental-vm-modules jest",
"lint": "eslint . && prettier . --config ../../.prettierrc --ignore-path ../../.prettierignore -c",
"lint:fix": "eslint . --fix && prettier . --config ../../.prettierrc --ignore-path ../../.prettierignore -w --log-level error",
"generate": "openapi-generator --generateESM --clearOutputDir -i ./src/spec/api.yaml -o ./src/client && pnpm update-imports && pnpm lint:fix",
"generate": "openapi-generator --generateESM --clearOutputDir -i ./src/spec/api.yaml -o ./src/client -s ./src/spec/options-per-service.json && pnpm update-imports && pnpm lint:fix",
"update-imports": "node --no-warnings --loader ts-node/esm ../../scripts/update-imports.ts ./src/client/api"
},
"dependencies": {
Expand Down
26 changes: 16 additions & 10 deletions packages/document-grounding/src/client/api/pipelines-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import type {
* This API is part of the 'api' service.
*/
export const PipelinesApi = {
_defaultBasePath: '/lm/document-grounding',
/**
* Get all pipelines
* @param queryParameters - Object containing the following keys: $top, $skip, $count.
Expand All @@ -28,11 +29,12 @@ export const PipelinesApi = {
) =>
new OpenApiRequestBuilder<Pipelines>(
'get',
'/lm/document-grounding/pipelines',
'/pipelines',
{
queryParameters,
headerParameters
}
},
PipelinesApi._defaultBasePath
),
/**
* Create a pipeline
Expand All @@ -46,11 +48,12 @@ export const PipelinesApi = {
) =>
new OpenApiRequestBuilder<PipelineId>(
'post',
'/lm/document-grounding/pipelines',
'/pipelines',
{
body,
headerParameters
}
},
PipelinesApi._defaultBasePath
),
/**
* Get details of a pipeline by pipeline id
Expand All @@ -64,11 +67,12 @@ export const PipelinesApi = {
) =>
new OpenApiRequestBuilder<Pipeline>(
'get',
'/lm/document-grounding/pipelines/{pipelineId}',
'/pipelines/{pipelineId}',
{
pathParameters: { pipelineId },
headerParameters
}
},
PipelinesApi._defaultBasePath
),
/**
* Delete a pipeline by pipeline id
Expand All @@ -82,11 +86,12 @@ export const PipelinesApi = {
) =>
new OpenApiRequestBuilder<any>(
'delete',
'/lm/document-grounding/pipelines/{pipelineId}',
'/pipelines/{pipelineId}',
{
pathParameters: { pipelineId },
headerParameters
}
},
PipelinesApi._defaultBasePath
),
/**
* Get pipeline status by pipeline id
Expand All @@ -100,10 +105,11 @@ export const PipelinesApi = {
) =>
new OpenApiRequestBuilder<PipelineStatus>(
'get',
'/lm/document-grounding/pipelines/{pipelineId}/status',
'/pipelines/{pipelineId}/status',
{
pathParameters: { pipelineId },
headerParameters
}
},
PipelinesApi._defaultBasePath
)
};
16 changes: 10 additions & 6 deletions packages/document-grounding/src/client/api/retrieval-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import type {
* This API is part of the 'api' service.
*/
export const RetrievalApi = {
_defaultBasePath: '/lm/document-grounding',
/**
* List all DataRepository objects.
* @param queryParameters - Object containing the following keys: $top, $skip, $count.
Expand All @@ -27,11 +28,12 @@ export const RetrievalApi = {
) =>
new OpenApiRequestBuilder<DataRepositories>(
'get',
'/lm/document-grounding/retrieval/dataRepositories',
'/retrieval/dataRepositories',
{
queryParameters,
headerParameters
}
},
RetrievalApi._defaultBasePath
),
/**
* List single DataRepository object.
Expand All @@ -45,11 +47,12 @@ export const RetrievalApi = {
) =>
new OpenApiRequestBuilder<DataRepository>(
'get',
'/lm/document-grounding/retrieval/dataRepositories/{repositoryId}',
'/retrieval/dataRepositories/{repositoryId}',
{
pathParameters: { repositoryId },
headerParameters
}
},
RetrievalApi._defaultBasePath
),
/**
* Retrieve relevant content given a query string.
Expand All @@ -63,10 +66,11 @@ export const RetrievalApi = {
) =>
new OpenApiRequestBuilder<RetievalSearchResults>(
'post',
'/lm/document-grounding/retrieval/search',
'/retrieval/search',
{
body,
headerParameters
}
},
RetrievalApi._defaultBasePath
)
};
77 changes: 49 additions & 28 deletions packages/document-grounding/src/client/api/vector-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import type {
* This API is part of the 'api' service.
*/
export const VectorApi = {
_defaultBasePath: '/lm/document-grounding',
/**
* Gets a list of collections.
* @param queryParameters - Object containing the following keys: $top, $skip, $count.
Expand All @@ -36,11 +37,12 @@ export const VectorApi = {
) =>
new OpenApiRequestBuilder<CollectionsListResponse>(
'get',
'/lm/document-grounding/vector/collections',
'/vector/collections',
{
queryParameters,
headerParameters
}
},
VectorApi._defaultBasePath
),
/**
* Creates a collection. This operation is asynchronous. Poll the collection resource and check the status field to understand creation status.
Expand All @@ -54,11 +56,12 @@ export const VectorApi = {
) =>
new OpenApiRequestBuilder<any>(
'post',
'/lm/document-grounding/vector/collections',
'/vector/collections',
{
body,
headerParameters
}
},
VectorApi._defaultBasePath
),
/**
* Gets a specific collection by ID.
Expand All @@ -72,11 +75,12 @@ export const VectorApi = {
) =>
new OpenApiRequestBuilder<Collection>(
'get',
'/lm/document-grounding/vector/collections/{collectionId}',
'/vector/collections/{collectionId}',
{
pathParameters: { collectionId },
headerParameters
}
},
VectorApi._defaultBasePath
),
/**
* Deletes a specific collection by ID. This operation is asynchronous. Poll the collection for a 404 status code.
Expand All @@ -90,11 +94,12 @@ export const VectorApi = {
) =>
new OpenApiRequestBuilder<any>(
'delete',
'/lm/document-grounding/vector/collections/{collectionId}',
'/vector/collections/{collectionId}',
{
pathParameters: { collectionId },
headerParameters
}
},
VectorApi._defaultBasePath
),
/**
* Gets a specific document in a collection by ID.
Expand All @@ -110,11 +115,12 @@ export const VectorApi = {
) =>
new OpenApiRequestBuilder<DocumentResponse>(
'get',
'/lm/document-grounding/vector/collections/{collectionId}/documents/{documentId}',
'/vector/collections/{collectionId}/documents/{documentId}',
{
pathParameters: { collectionId, documentId },
headerParameters
}
},
VectorApi._defaultBasePath
),
/**
* Deletes a specific document of a collection.
Expand All @@ -130,11 +136,12 @@ export const VectorApi = {
) =>
new OpenApiRequestBuilder<any>(
'delete',
'/lm/document-grounding/vector/collections/{collectionId}/documents/{documentId}',
'/vector/collections/{collectionId}/documents/{documentId}',
{
pathParameters: { collectionId, documentId },
headerParameters
}
},
VectorApi._defaultBasePath
),
/**
* Gets a list of documents of a collection.
Expand All @@ -150,12 +157,13 @@ export const VectorApi = {
) =>
new OpenApiRequestBuilder<Documents>(
'get',
'/lm/document-grounding/vector/collections/{collectionId}/documents',
'/vector/collections/{collectionId}/documents',
{
pathParameters: { collectionId },
queryParameters,
headerParameters
}
},
VectorApi._defaultBasePath
),
/**
* Create and stores one or multiple documents into a collection. If omitted, 'id' will be auto-generated.
Expand All @@ -171,12 +179,13 @@ export const VectorApi = {
) =>
new OpenApiRequestBuilder<DocumentsListResponse>(
'post',
'/lm/document-grounding/vector/collections/{collectionId}/documents',
'/vector/collections/{collectionId}/documents',
{
pathParameters: { collectionId },
body,
headerParameters
}
},
VectorApi._defaultBasePath
),
/**
* Upserts the data of multiple documents into a collection.
Expand All @@ -192,12 +201,13 @@ export const VectorApi = {
) =>
new OpenApiRequestBuilder<DocumentsListResponse>(
'patch',
'/lm/document-grounding/vector/collections/{collectionId}/documents',
'/vector/collections/{collectionId}/documents',
{
pathParameters: { collectionId },
body,
headerParameters
}
},
VectorApi._defaultBasePath
),
/**
* Search chunk by vector
Expand All @@ -211,11 +221,12 @@ export const VectorApi = {
) =>
new OpenApiRequestBuilder<SearchResults>(
'post',
'/lm/document-grounding/vector/search',
'/vector/search',
{
body,
headerParameters
}
},
VectorApi._defaultBasePath
),
/**
* Gets a specific collection status from monitor by ID.
Expand All @@ -229,10 +240,15 @@ export const VectorApi = {
) =>
new OpenApiRequestBuilder<
CollectionCreatedResponse | CollectionPendingResponse
>('get', '/lm/document-grounding/vector/collections/{id}/creationStatus', {
pathParameters: { id },
headerParameters
}),
>(
'get',
'/vector/collections/{id}/creationStatus',
{
pathParameters: { id },
headerParameters
},
VectorApi._defaultBasePath
),
/**
* Gets a specific collection status from monitor by ID.
* @param id - Path parameter.
Expand All @@ -245,8 +261,13 @@ export const VectorApi = {
) =>
new OpenApiRequestBuilder<
CollectionDeletedResponse | CollectionPendingResponse
>('get', '/lm/document-grounding/vector/collections/{id}/deletionStatus', {
pathParameters: { id },
headerParameters
})
>(
'get',
'/vector/collections/{id}/deletionStatus',
{
pathParameters: { id },
headerParameters
},
VectorApi._defaultBasePath
)
};
Loading
Loading