samuel-integrations-sdk 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +69 -0
- package/dist/generated-api.d.ts +76 -0
- package/dist/generated-api.d.ts.map +1 -0
- package/dist/generated-api.js +37 -0
- package/dist/generated-api.js.map +1 -0
- package/dist/http-client.d.ts +10 -0
- package/dist/http-client.d.ts.map +1 -0
- package/dist/http-client.js +33 -0
- package/dist/http-client.js.map +1 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +52 -0
- package/dist/index.js.map +1 -0
- package/package.json +51 -0
package/README.md
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Samuel Agent Types SDK
|
|
2
|
+
|
|
3
|
+
A TypeScript SDK for Agent Builder types, providing type-safe interfaces and utilities.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- 🎯 **TypeScript First**: Built with TypeScript for excellent developer experience
|
|
8
|
+
- 🔧 **Modern Tooling**: ESLint and Prettier for code quality and formatting
|
|
9
|
+
- 📦 **Ready to Publish**: Configured for npm package distribution
|
|
10
|
+
- 🚀 **Zero Config**: Minimal setup required
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install samuel-agent-types-sdk
|
|
16
|
+
# or
|
|
17
|
+
yarn add samuel-agent-types-sdk
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Development
|
|
21
|
+
|
|
22
|
+
### Prerequisites
|
|
23
|
+
|
|
24
|
+
- Node.js (v16 or higher)
|
|
25
|
+
- Yarn
|
|
26
|
+
|
|
27
|
+
### Setup
|
|
28
|
+
|
|
29
|
+
1. Clone the repository
|
|
30
|
+
2. Install dependencies:
|
|
31
|
+
```bash
|
|
32
|
+
yarn install
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Available Scripts
|
|
36
|
+
|
|
37
|
+
- `yarn build` - Build the TypeScript code
|
|
38
|
+
- `yarn dev` - Watch mode for development
|
|
39
|
+
- `yarn lint` - Run ESLint
|
|
40
|
+
- `yarn lint:fix` - Fix ESLint issues automatically
|
|
41
|
+
- `yarn format` - Format code with Prettier
|
|
42
|
+
- `yarn format:check` - Check code formatting
|
|
43
|
+
- `yarn clean` - Clean build artifacts
|
|
44
|
+
|
|
45
|
+
### Project Structure
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
samuel-agent-types-sdk/
|
|
49
|
+
├── src/
|
|
50
|
+
│ └── index.ts # Main SDK entry point
|
|
51
|
+
├── dist/ # Compiled output (generated)
|
|
52
|
+
├── eslint.config.js # ESLint configuration
|
|
53
|
+
├── .prettierrc # Prettier configuration
|
|
54
|
+
├── tsconfig.json # TypeScript configuration
|
|
55
|
+
├── package.json # Package configuration
|
|
56
|
+
└── README.md # This file
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Contributing
|
|
60
|
+
|
|
61
|
+
1. Fork the repository
|
|
62
|
+
2. Create a feature branch
|
|
63
|
+
3. Make your changes
|
|
64
|
+
4. Run linting and formatting: `yarn lint && yarn format`
|
|
65
|
+
5. Submit a pull request
|
|
66
|
+
|
|
67
|
+
## License
|
|
68
|
+
|
|
69
|
+
MIT License - see LICENSE file for details.
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Role of the message sender
|
|
3
|
+
*/
|
|
4
|
+
export type GenerateBodyMessagesItemRole = typeof GenerateBodyMessagesItemRole[keyof typeof GenerateBodyMessagesItemRole];
|
|
5
|
+
export declare const GenerateBodyMessagesItemRole: {
|
|
6
|
+
readonly user: "user";
|
|
7
|
+
readonly assistant: "assistant";
|
|
8
|
+
readonly system: "system";
|
|
9
|
+
};
|
|
10
|
+
export type GenerateBodyMessagesItem = {
|
|
11
|
+
/** Role of the message sender */
|
|
12
|
+
role: GenerateBodyMessagesItemRole;
|
|
13
|
+
/** Content of the message */
|
|
14
|
+
content: string;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* LLM provider to use
|
|
18
|
+
*/
|
|
19
|
+
export type GenerateBodyProvider = typeof GenerateBodyProvider[keyof typeof GenerateBodyProvider];
|
|
20
|
+
export declare const GenerateBodyProvider: {
|
|
21
|
+
readonly anthropic: "anthropic";
|
|
22
|
+
readonly openai: "openai";
|
|
23
|
+
readonly gemini: "gemini";
|
|
24
|
+
};
|
|
25
|
+
export type GenerateBodyOptions = {
|
|
26
|
+
/**
|
|
27
|
+
* Sampling temperature (0-2)
|
|
28
|
+
* @minimum 0
|
|
29
|
+
* @maximum 2
|
|
30
|
+
*/
|
|
31
|
+
temperature?: number;
|
|
32
|
+
/**
|
|
33
|
+
* Maximum tokens to generate
|
|
34
|
+
* @minimum 0
|
|
35
|
+
* @exclusiveMinimum
|
|
36
|
+
*/
|
|
37
|
+
maxTokens?: number;
|
|
38
|
+
/**
|
|
39
|
+
* Top-p sampling parameter
|
|
40
|
+
* @minimum 0
|
|
41
|
+
* @maximum 1
|
|
42
|
+
*/
|
|
43
|
+
topP?: number;
|
|
44
|
+
};
|
|
45
|
+
export type GenerateBody = {
|
|
46
|
+
/**
|
|
47
|
+
* Array of chat messages
|
|
48
|
+
* @minItems 1
|
|
49
|
+
*/
|
|
50
|
+
messages: GenerateBodyMessagesItem[];
|
|
51
|
+
/** LLM provider to use */
|
|
52
|
+
provider: GenerateBodyProvider;
|
|
53
|
+
/** Specific model to use (defaults to provider default) */
|
|
54
|
+
model?: string;
|
|
55
|
+
options?: GenerateBodyOptions;
|
|
56
|
+
/** Custom API key (uses environment variable if not provided) */
|
|
57
|
+
apiKey?: string;
|
|
58
|
+
};
|
|
59
|
+
export type Generate200Data = {
|
|
60
|
+
/** Generated text content */
|
|
61
|
+
content: string;
|
|
62
|
+
/** Provider used */
|
|
63
|
+
provider: string;
|
|
64
|
+
/** Model used */
|
|
65
|
+
model: string;
|
|
66
|
+
};
|
|
67
|
+
export type Generate200 = {
|
|
68
|
+
/** Status message */
|
|
69
|
+
message: string;
|
|
70
|
+
data: Generate200Data;
|
|
71
|
+
};
|
|
72
|
+
export declare const getIntegrationsAPI: () => {
|
|
73
|
+
generate: (generateBody: GenerateBody) => Promise<Generate200>;
|
|
74
|
+
};
|
|
75
|
+
export type GenerateResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getIntegrationsAPI>['generate']>>>;
|
|
76
|
+
//# sourceMappingURL=generated-api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-api.d.ts","sourceRoot":"","sources":["../src/generated-api.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,MAAM,MAAM,4BAA4B,GAAG,OAAO,4BAA4B,CAAC,MAAM,OAAO,4BAA4B,CAAC,CAAC;AAI1H,eAAO,MAAM,4BAA4B;;;;CAI/B,CAAC;AAEX,MAAM,MAAM,wBAAwB,GAAG;IACrC,iCAAiC;IACjC,IAAI,EAAE,4BAA4B,CAAC;IACnC,6BAA6B;IAC7B,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,OAAO,oBAAoB,CAAC,MAAM,OAAO,oBAAoB,CAAC,CAAC;AAIlG,eAAO,MAAM,oBAAoB;;;;CAIvB,CAAC;AAEX,MAAM,MAAM,mBAAmB,GAAG;IAChC;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB;;;OAGG;IACH,QAAQ,EAAE,wBAAwB,EAAE,CAAC;IACrC,0BAA0B;IAC1B,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,2DAA2D;IAC3D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAC9B,iEAAiE;IACjE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,6BAA6B;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,oBAAoB;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,iBAAiB;IACjB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,qBAAqB;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,eAAe,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,kBAAkB;6BAKb,YAAY;CAUZ,CAAC;AACnB,MAAM,MAAM,cAAc,GAAG,WAAW,CAAC,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getIntegrationsAPI = exports.GenerateBodyProvider = exports.GenerateBodyMessagesItemRole = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Generated by orval v7.21.0 🍺
|
|
6
|
+
* Do not edit manually.
|
|
7
|
+
* Integrations API
|
|
8
|
+
* API for integrating with external services like LLMs, Stripe, etc.
|
|
9
|
+
* OpenAPI spec version: 1.0.0
|
|
10
|
+
*/
|
|
11
|
+
const http_client_1 = require("./http-client");
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
13
|
+
exports.GenerateBodyMessagesItemRole = {
|
|
14
|
+
user: 'user',
|
|
15
|
+
assistant: 'assistant',
|
|
16
|
+
system: 'system',
|
|
17
|
+
};
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
19
|
+
exports.GenerateBodyProvider = {
|
|
20
|
+
anthropic: 'anthropic',
|
|
21
|
+
openai: 'openai',
|
|
22
|
+
gemini: 'gemini',
|
|
23
|
+
};
|
|
24
|
+
const getIntegrationsAPI = () => {
|
|
25
|
+
/**
|
|
26
|
+
* @summary Chat with LLM
|
|
27
|
+
*/
|
|
28
|
+
const generate = (generateBody) => {
|
|
29
|
+
return (0, http_client_1.customAxios)({ url: `/llm/generate`, method: 'POST',
|
|
30
|
+
headers: { 'Content-Type': 'application/json', },
|
|
31
|
+
data: generateBody
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
return { generate };
|
|
35
|
+
};
|
|
36
|
+
exports.getIntegrationsAPI = getIntegrationsAPI;
|
|
37
|
+
//# sourceMappingURL=generated-api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-api.js","sourceRoot":"","sources":["../src/generated-api.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACH,+CAA4C;AAO5C,2DAA2D;AAC9C,QAAA,4BAA4B,GAAG;IAC1C,IAAI,EAAE,MAAM;IACZ,SAAS,EAAE,WAAW;IACtB,MAAM,EAAE,QAAQ;CACR,CAAC;AAeX,2DAA2D;AAC9C,QAAA,oBAAoB,GAAG;IAClC,SAAS,EAAE,WAAW;IACtB,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;CACR,CAAC;AAqDJ,MAAM,kBAAkB,GAAG,GAAG,EAAE;IACvC;;OAEG;IACH,MAAM,QAAQ,GAAG,CACb,YAA0B,EAC3B,EAAE;QACC,OAAO,IAAA,yBAAW,EAClB,EAAC,GAAG,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM;YACrC,OAAO,EAAE,EAAC,cAAc,EAAE,kBAAkB,GAAG;YAC/C,IAAI,EAAE,YAAY;SACnB,CACE,CAAC;IACJ,CAAC,CAAA;IAEL,OAAO,EAAC,QAAQ,EAAC,CAAA;AAAA,CAAC,CAAC;AAfN,QAAA,kBAAkB,sBAeZ"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AxiosRequestConfig } from 'axios';
|
|
2
|
+
import { AsyncLocalStorage } from 'async_hooks';
|
|
3
|
+
interface SDKContext {
|
|
4
|
+
accessKey?: string;
|
|
5
|
+
baseUrl?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const sdkContext: AsyncLocalStorage<SDKContext>;
|
|
8
|
+
export declare const customAxios: <T>(config: AxiosRequestConfig) => Promise<T>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=http-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-client.d.ts","sourceRoot":"","sources":["../src/http-client.ts"],"names":[],"mappings":"AAAA,OAAc,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,UAAU,UAAU;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,UAAU,+BAAsC,CAAC;AA2B9D,eAAO,MAAM,WAAW,GAAU,CAAC,EAAE,QAAQ,kBAAkB,KAAG,OAAO,CAAC,CAAC,CAG1E,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.customAxios = exports.sdkContext = void 0;
|
|
7
|
+
const axios_1 = __importDefault(require("axios"));
|
|
8
|
+
const async_hooks_1 = require("async_hooks");
|
|
9
|
+
exports.sdkContext = new async_hooks_1.AsyncLocalStorage();
|
|
10
|
+
const axiosInstance = axios_1.default.create();
|
|
11
|
+
axiosInstance.interceptors.request.use((config) => {
|
|
12
|
+
const context = exports.sdkContext.getStore();
|
|
13
|
+
const baseURL = context?.baseUrl || process.env["INTEGRATION_BASE_URL"];
|
|
14
|
+
if (baseURL) {
|
|
15
|
+
config.baseURL = baseURL;
|
|
16
|
+
}
|
|
17
|
+
const accessKey = context?.accessKey || process.env["PROJECT_ACCESS_KEY"];
|
|
18
|
+
const tenantId = process.env["TENANT_ID"];
|
|
19
|
+
if (accessKey) {
|
|
20
|
+
config.headers = config.headers || {};
|
|
21
|
+
config.headers['x-project-access-key'] = accessKey;
|
|
22
|
+
if (tenantId) {
|
|
23
|
+
config.headers['x-tenant-id'] = tenantId;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return config;
|
|
27
|
+
});
|
|
28
|
+
const customAxios = async (config) => {
|
|
29
|
+
const { data } = await axiosInstance(config);
|
|
30
|
+
return data;
|
|
31
|
+
};
|
|
32
|
+
exports.customAxios = customAxios;
|
|
33
|
+
//# sourceMappingURL=http-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-client.js","sourceRoot":"","sources":["../src/http-client.ts"],"names":[],"mappings":";;;;;;AAAA,kDAAkD;AAClD,6CAAgD;AAOnC,QAAA,UAAU,GAAG,IAAI,+BAAiB,EAAc,CAAC;AAE9D,MAAM,aAAa,GAAG,eAAK,CAAC,MAAM,EAAE,CAAC;AAErC,aAAa,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;IAChD,MAAM,OAAO,GAAG,kBAAU,CAAC,QAAQ,EAAE,CAAC;IAEtC,MAAM,OAAO,GAAG,OAAO,EAAE,OAAO,IAAI,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;IACxE,IAAI,OAAO,EAAE,CAAC;QACZ,MAAM,CAAC,OAAO,GAAG,OAAO,CAAC;IAC3B,CAAC;IAED,MAAM,SAAS,GAAG,OAAO,EAAE,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IAC1E,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAE1C,IAAI,SAAS,EAAE,CAAC;QACd,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC;QACtC,MAAM,CAAC,OAAO,CAAC,sBAAsB,CAAC,GAAG,SAAS,CAAC;QACnD,IAAI,QAAQ,EAAE,CAAC;YACb,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,GAAG,QAAQ,CAAC;QAC3C,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC,CAAC;AAGI,MAAM,WAAW,GAAG,KAAK,EAAK,MAA0B,EAAc,EAAE;IAC7E,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,aAAa,CAAC,MAAM,CAAC,CAAC;IAC7C,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAHW,QAAA,WAAW,eAGtB"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UPTIQ Integrations SDK
|
|
3
|
+
*
|
|
4
|
+
* Auto-generated from OpenAPI specification.
|
|
5
|
+
* Do not edit this file manually - it will be overwritten on next generation.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Llm integration module
|
|
9
|
+
*/
|
|
10
|
+
export declare class Llm {
|
|
11
|
+
private config;
|
|
12
|
+
private api;
|
|
13
|
+
constructor(options?: {
|
|
14
|
+
accessKey?: string;
|
|
15
|
+
baseUrl?: string;
|
|
16
|
+
});
|
|
17
|
+
private withContext;
|
|
18
|
+
generate: (...args: Parameters<typeof this.api.generate>) => Promise<import("./generated-api").Generate200>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Default llm instance - ready to use with env vars
|
|
22
|
+
* @example
|
|
23
|
+
* import { llm } from 'uptiq-integration';
|
|
24
|
+
* await llm.generate({ ... });
|
|
25
|
+
*/
|
|
26
|
+
export declare const llm: Llm;
|
|
27
|
+
export * from './generated-api';
|
|
28
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AAEH;;GAEG;AACH,qBAAa,GAAG;IACd,OAAO,CAAC,MAAM,CAA2C;IACzD,OAAO,CAAC,GAAG,CAAwC;gBAEvC,OAAO,CAAC,EAAE;QACpB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB;IAQD,OAAO,CAAC,WAAW;IAInB,QAAQ,GAAI,GAAG,MAAM,UAAU,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,oDACJ;CACtD;AAED;;;;;GAKG;AACH,eAAO,MAAM,GAAG,KAAY,CAAC;AAG7B,cAAc,iBAAiB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.llm = exports.Llm = void 0;
|
|
18
|
+
const generated_api_1 = require("./generated-api");
|
|
19
|
+
const http_client_1 = require("./http-client");
|
|
20
|
+
/**
|
|
21
|
+
* UPTIQ Integrations SDK
|
|
22
|
+
*
|
|
23
|
+
* Auto-generated from OpenAPI specification.
|
|
24
|
+
* Do not edit this file manually - it will be overwritten on next generation.
|
|
25
|
+
*/
|
|
26
|
+
/**
|
|
27
|
+
* Llm integration module
|
|
28
|
+
*/
|
|
29
|
+
class Llm {
|
|
30
|
+
constructor(options) {
|
|
31
|
+
this.generate = (...args) => this.withContext(() => this.api.generate(...args));
|
|
32
|
+
// Store config for this instance (uses env vars if not provided)
|
|
33
|
+
this.config = options || {};
|
|
34
|
+
// Get the generated API methods
|
|
35
|
+
this.api = (0, generated_api_1.getIntegrationsAPI)();
|
|
36
|
+
}
|
|
37
|
+
// Helper to wrap API calls with context
|
|
38
|
+
withContext(fn) {
|
|
39
|
+
return http_client_1.sdkContext.run(this.config, fn);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.Llm = Llm;
|
|
43
|
+
/**
|
|
44
|
+
* Default llm instance - ready to use with env vars
|
|
45
|
+
* @example
|
|
46
|
+
* import { llm } from 'uptiq-integration';
|
|
47
|
+
* await llm.generate({ ... });
|
|
48
|
+
*/
|
|
49
|
+
exports.llm = new Llm();
|
|
50
|
+
// Re-export all types from generated API
|
|
51
|
+
__exportStar(require("./generated-api"), exports);
|
|
52
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,mDAAqD;AACrD,+CAA2C;AAE3C;;;;;GAKG;AAEH;;GAEG;AACH,MAAa,GAAG;IAId,YAAY,OAGX;QAYD,aAAQ,GAAG,CAAC,GAAG,IAA0C,EAAE,EAAE,CAC3D,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;QAZnD,iEAAiE;QACjE,IAAI,CAAC,MAAM,GAAG,OAAO,IAAI,EAAE,CAAC;QAC5B,gCAAgC;QAChC,IAAI,CAAC,GAAG,GAAG,IAAA,kCAAkB,GAAE,CAAC;IAClC,CAAC;IAED,wCAAwC;IAChC,WAAW,CAAI,EAAoB;QACzC,OAAO,wBAAU,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACzC,CAAC;CAIF;AArBD,kBAqBC;AAED;;;;;GAKG;AACU,QAAA,GAAG,GAAG,IAAI,GAAG,EAAE,CAAC;AAE7B,yCAAyC;AACzC,kDAAgC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "samuel-integrations-sdk",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "SDK for UPTIQ integrations",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
10
|
+
"scripts": {
|
|
11
|
+
"download:swagger": "bash scripts/download-swagger.sh",
|
|
12
|
+
"generate:api": "orval",
|
|
13
|
+
"generate:wrapper": "node scripts/generate-wrapper.ts",
|
|
14
|
+
"generate": "yarn download:swagger && yarn generate:api && yarn generate:wrapper",
|
|
15
|
+
"build": "tsc",
|
|
16
|
+
"prepublishOnly": "yarn generate && yarn build",
|
|
17
|
+
"dev": "tsc --watch",
|
|
18
|
+
"lint": "eslint src/**/*.ts",
|
|
19
|
+
"lint:fix": "eslint src/**/*.ts --fix",
|
|
20
|
+
"format": "prettier --write src/**/*.ts",
|
|
21
|
+
"format:check": "prettier --check src/**/*.ts",
|
|
22
|
+
"clean": "rm -rf dist",
|
|
23
|
+
"prebuild": "yarn clean"
|
|
24
|
+
},
|
|
25
|
+
"keywords": [
|
|
26
|
+
"samuel",
|
|
27
|
+
"integrations",
|
|
28
|
+
"sdk"
|
|
29
|
+
],
|
|
30
|
+
"author": "UPTIQ",
|
|
31
|
+
"license": "MIT",
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"orval": "^7.1.0",
|
|
34
|
+
"@types/node": "^24.0.3",
|
|
35
|
+
"@typescript-eslint/eslint-plugin": "^8.35.0",
|
|
36
|
+
"@typescript-eslint/parser": "^8.35.0",
|
|
37
|
+
"eslint": "^9.29.0",
|
|
38
|
+
"eslint-config-prettier": "^10.1.5",
|
|
39
|
+
"eslint-plugin-prettier": "^5.5.0",
|
|
40
|
+
"prettier": "^3.6.0",
|
|
41
|
+
"typescript": "^5.8.3"
|
|
42
|
+
},
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"axios": "^1.6.0",
|
|
45
|
+
"zod": "^4.0.10"
|
|
46
|
+
},
|
|
47
|
+
"publishConfig": {
|
|
48
|
+
"registry": "https://registry.npmjs.org/",
|
|
49
|
+
"access": "public"
|
|
50
|
+
}
|
|
51
|
+
}
|