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

feat: RAGe client #300

Closed
wants to merge 25 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
cfdf691
chore: initial commit
KavithaSiva Nov 18, 2024
77d987b
chore:add generated client
KavithaSiva Nov 18, 2024
45c728d
chore: update pnpm lockfile
KavithaSiva Nov 18, 2024
f46bce2
chore: fix eslint issues
KavithaSiva Nov 18, 2024
d1887b1
chore: ensure CJS compatibility
KavithaSiva Nov 18, 2024
cb65dff
chore: progress till now
KavithaSiva Nov 19, 2024
47c45c4
chore: add an E2E test for vector creation
KavithaSiva Nov 19, 2024
2685440
Merge branch 'main' into feat/rage-client
KavithaSiva Nov 25, 2024
811ad4e
fix: broken build
KavithaSiva Nov 25, 2024
9d89d16
chore: e2e test for vector api
KavithaSiva Nov 27, 2024
613091a
chore: add e2e test for document creation under a collection
KavithaSiva Nov 28, 2024
9ae18fc
chore: add retrieval end point to test
KavithaSiva Nov 28, 2024
3b8e5ea
fix: Changes from lint
Nov 28, 2024
c232565
chore: make rage private
KavithaSiva Nov 28, 2024
3b33aa5
Merge branch 'feat/rage-client' of github.com:SAP/ai-sdk-js into feat…
KavithaSiva Nov 28, 2024
4f0145d
chore: add todos
KavithaSiva Nov 28, 2024
36414c7
Update packages/rage/src/index.ts
jjtang1985 Nov 28, 2024
5533a6f
Revert "Update packages/rage/src/index.ts"
jjtang1985 Nov 28, 2024
020cf0e
Merge branch 'main' into feat/rage-client
KavithaSiva Nov 28, 2024
c95f29a
Merge branch 'main' into feat/rage-client
KavithaSiva Nov 28, 2024
b6d08bf
chore: potentially fix public api checks
KavithaSiva Nov 28, 2024
08630b5
chore: second try to workaround public api check
KavithaSiva Nov 28, 2024
8e75c8d
chore: fix depedency checks
KavithaSiva Nov 28, 2024
1dfa5e2
chore: update pnpm lock file
KavithaSiva Nov 28, 2024
24875e5
chore: remove unused dependency
KavithaSiva Nov 28, 2024
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
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"lint:fix": "pnpm -r run lint:fix",
"generate": "pnpm -r run generate",
"ai-api": "pnpm -F=@sap-ai-sdk/ai-api",
"rage": "pnpm -F=@sap-ai-sdk/rage",
"foundation-models": "pnpm -F=@sap-ai-sdk/foundation-models",
"orchestration": "pnpm -F=@sap-ai-sdk/orchestration",
"core": "pnpm -F=@sap-ai-sdk/core",
Expand Down
2 changes: 2 additions & 0 deletions packages/rage/internal.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './dist/internal.js';
//# sourceMappingURL=internal.d.ts.map
2 changes: 2 additions & 0 deletions packages/rage/internal.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions packages/rage/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"name": "@sap-ai-sdk/rage",
"version": "1.3.0",
"description": "",
"license": "Apache-2.0",
"keywords": [
"sap-ai-sdk",
"rage"
],
"type": "module",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"files": [
"dist/**/*.js",
"dist/**/*.js.map",
"dist/**/*.d.ts",
"dist/**/*.d.ts.map",
"internal.js",
"internal.d.ts"
],
"private": true,
"scripts": {
"compile": "tsc",
"compile:cjs": "tsc -p tsconfig.cjs.json",
"lint": "eslint . && prettier . --config ../../.prettierrc --ignore-path ../../.prettierignore -c",
"lint:fix": "eslint . --fix && prettier . --config ../../.prettierrc --ignore-path ../../.prettierignore -w --log-level error",
"generate:vector": "openapi-generator --generateESM --clearOutputDir -i ./src/spec/vector-api.yaml -o ./src/client/vector && pnpm update-imports && pnpm lint:fix",
"generate:pipeline": "openapi-generator --generateESM --clearOutputDir -i ./src/spec/pipeline-api.yaml -o ./src/client/pipeline && pnpm update-imports && pnpm lint:fix",
"generate:retrieval": "openapi-generator --generateESM --clearOutputDir -i ./src/spec/retrieval-api.yaml -o ./src/client/retrieval && pnpm update-imports && pnpm lint:fix",
"update-imports": "node --no-warnings --loader ts-node/esm ../../scripts/update-imports.ts ./src/client",
"check:public-api": "node --loader ts-node/esm ../../scripts/check-public-api-cli.ts"
},
"dependencies": {
"@sap-ai-sdk/core": "workspace:^"
}
}
93 changes: 93 additions & 0 deletions packages/rage/src/client/pipeline/pipeline-api/default-api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
/*
* Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
*
* This is a generated file powered by the SAP Cloud SDK for JavaScript.
*/
import { OpenApiRequestBuilder } from '@sap-ai-sdk/core';
import type {
GetPipelines,
CreatePipeline,
PipelineId,
GetPipeline,
GetPipelineStatus
} from './schema/index.js';
/**
* Representation of the 'DefaultApi'.
* This API is part of the 'pipeline-api' service.
*/
export const DefaultApi = {
/**
* Get all pipelines
* @param queryParameters - Object containing the following keys: $top, $skip, $count.
* @param headerParameters - Object containing the following keys: AI-Resource-Group.
* @returns The request builder, use the `execute()` method to trigger the request.
*/
pipelineV1PipelineEndpointsGetAllPipeline: (
queryParameters: { $top?: number; $skip?: number; $count?: boolean },
headerParameters: { 'AI-Resource-Group': string }
) =>
new OpenApiRequestBuilder<GetPipelines>('get', '/pipelines', {
queryParameters,
headerParameters
}),
/**
* Create a pipeline
* @param body - Request body.
* @param headerParameters - Object containing the following keys: AI-Resource-Group.
* @returns The request builder, use the `execute()` method to trigger the request.
*/
pipelineV1PipelineEndpointsCreatePipeline: (
body: CreatePipeline,
headerParameters: { 'AI-Resource-Group': string }
) =>
new OpenApiRequestBuilder<PipelineId>('post', '/pipelines', {
body,
headerParameters
}),
/**
* Get details of a pipeline by pipeline id
* @param pipelineId - The ID of the pipeline to get.
* @param headerParameters - Object containing the following keys: AI-Resource-Group.
* @returns The request builder, use the `execute()` method to trigger the request.
*/
pipelineV1PipelineEndpointsGetPipelineById: (
pipelineId: string,
headerParameters: { 'AI-Resource-Group': string }
) =>
new OpenApiRequestBuilder<GetPipeline>('get', '/pipelines/{pipelineId}', {
pathParameters: { pipelineId },
headerParameters
}),
/**
* Delete a pipeline by pipeline id
* @param pipelineId - The ID of the pipeline to delete.
* @param headerParameters - Object containing the following keys: AI-Resource-Group.
* @returns The request builder, use the `execute()` method to trigger the request.
*/
pipelineV1PipelineEndpointsDeletePipelineById: (
pipelineId: string,
headerParameters: { 'AI-Resource-Group': string }
) =>
new OpenApiRequestBuilder<any>('delete', '/pipelines/{pipelineId}', {
pathParameters: { pipelineId },
headerParameters
}),
/**
* Get pipeline status by pipeline id
* @param pipelineId - The ID of the pipeline to get status.
* @param headerParameters - Object containing the following keys: AI-Resource-Group.
* @returns The request builder, use the `execute()` method to trigger the request.
*/
pipelineV1PipelineEndpointsGetPipelineStatus: (
pipelineId: string,
headerParameters: { 'AI-Resource-Group': string }
) =>
new OpenApiRequestBuilder<GetPipelineStatus>(
'get',
'/pipelines/{pipelineId}/status',
{
pathParameters: { pipelineId },
headerParameters
}
)
};
7 changes: 7 additions & 0 deletions packages/rage/src/client/pipeline/pipeline-api/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
* Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
*
* This is a generated file powered by the SAP Cloud SDK for JavaScript.
*/
export * from './default-api.js';
export * from './schema/index.js';
28 changes: 28 additions & 0 deletions packages/rage/src/client/pipeline/pipeline-api/schema/api-error.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
*
* This is a generated file powered by the SAP Cloud SDK for JavaScript.
*/
import type { DetailsErrorResponse } from './details-error-response.js';
/**
* Representation of the 'ApiError' schema.
*/
export type ApiError = {
/**
* Descriptive error code (not http status code).
*/
code: string;
/**
* plaintext error description
*/
message: string;
/**
* id of individual request
*/
requestId?: string;
/**
* url that has been called
*/
target?: string;
details?: DetailsErrorResponse[];
} & Record<string, any>;
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
*
* This is a generated file powered by the SAP Cloud SDK for JavaScript.
*/

/**
* Representation of the 'CreatePipeline' schema.
*/
export type CreatePipeline = {
/**
* @example "MSSharePoint"
*/
type: string;
configuration: {
/**
* @example "destination-name"
*/
destination: string;
sharePoint?: {
site?: {
/**
* @example "sharepoint-site-name"
*/
name?: string;
/**
* @example [
* "/testFolder1",
* "testFolder2"
* ]
*/
includePaths?: string[];
} & Record<string, any>;
} & Record<string, any>;
} & Record<string, any>;
} & Record<string, any>;
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
*
* This is a generated file powered by the SAP Cloud SDK for JavaScript.
*/

/**
* Representation of the 'DetailsErrorResponse' schema.
*/
export type DetailsErrorResponse = {
/**
* Descriptive error code (not http status code)
*/
code?: string;
/**
* Plaintext error description
*/
message?: string;
} & Record<string, any>;
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
*
* This is a generated file powered by the SAP Cloud SDK for JavaScript.
*/

/**
* Representation of the 'GetPipelineStatus' schema.
*/
export type GetPipelineStatus = {
/**
* @example "2024-02-15T12:45:00.000Z"
* Format: "date-time".
*/
lastStarted?: string;
} & Record<string, any>;
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
*
* This is a generated file powered by the SAP Cloud SDK for JavaScript.
*/

/**
* Representation of the 'GetPipeline' schema.
*/
export type GetPipeline = {
/**
* @example "uuid"
*/
id?: string;
/**
* @example "MSSharePoint"
*/
type?: string;
configuration?: {
/**
* @example "destination-name"
*/
destination?: string;
sharePoint?: {
site?: {
/**
* @example "sharepoint-site-id"
*/
id?: string;
/**
* @example "sharepoint-site-name"
*/
name?: string;
/**
* @example [
* "/testFolder1",
* "testFolder2"
* ]
*/
includePaths?: string[];
} & Record<string, any>;
} & Record<string, any>;
} & Record<string, any>;
} & Record<string, any>;
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
*
* This is a generated file powered by the SAP Cloud SDK for JavaScript.
*/
import type { GetPipeline } from './get-pipeline.js';
/**
* Representation of the 'GetPipelines' schema.
*/
export type GetPipelines = {
resources: GetPipeline[];
count?: number;
} & Record<string, any>;
12 changes: 12 additions & 0 deletions packages/rage/src/client/pipeline/pipeline-api/schema/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
*
* This is a generated file powered by the SAP Cloud SDK for JavaScript.
*/
export * from './create-pipeline.js';
export * from './get-pipelines.js';
export * from './get-pipeline.js';
export * from './get-pipeline-status.js';
export * from './pipeline-id.js';
export * from './api-error.js';
export * from './details-error-response.js';
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
*
* This is a generated file powered by the SAP Cloud SDK for JavaScript.
*/

/**
* Representation of the 'PipelineId' schema.
*/
export type PipelineId = {
/**
* @example "uuid"
*/
pipelineId?: string;
} & Record<string, any>;
8 changes: 8 additions & 0 deletions packages/rage/src/client/retrieval/retrieval-api/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
* Copyright (c) 2024 SAP SE or an SAP affiliate company. All rights reserved.
*
* This is a generated file powered by the SAP Cloud SDK for JavaScript.
*/
export * from './retrieval-data-repository-api.js';
export * from './retrieval-federated-search-across-data-repositories-api.js';
export * from './schema/index.js';
Loading
Loading