shivanya-ai 0.1.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/dist/ai.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ import type { ShivanyaClient } from "shivanya-core";
2
+ import type { AIChatRequest, AIChatResponse } from "./types.js";
3
+ export declare class ShivanyaAI {
4
+ private readonly client;
5
+ constructor(client: ShivanyaClient);
6
+ chat(request: AIChatRequest): Promise<AIChatResponse>;
7
+ }
package/dist/ai.js ADDED
@@ -0,0 +1,21 @@
1
+ export class ShivanyaAI {
2
+ client;
3
+ constructor(client) {
4
+ this.client = client;
5
+ }
6
+ async chat(request) {
7
+ return this.client.request("/api/ai/chat", {
8
+ method: "POST",
9
+ body: JSON.stringify({
10
+ messages: [
11
+ {
12
+ role: "user",
13
+ content: request.message,
14
+ },
15
+ ],
16
+ model: request.model,
17
+ temperature: request.temperature,
18
+ }),
19
+ });
20
+ }
21
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./ai.js";
2
+ export * from "./types.js";
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ export * from "./ai.js";
2
+ export * from "./types.js";
@@ -0,0 +1,9 @@
1
+ export interface AIChatRequest {
2
+ message: string;
3
+ model?: string;
4
+ temperature?: number;
5
+ }
6
+ export interface AIChatResponse {
7
+ content: string;
8
+ model: string;
9
+ }
package/dist/types.js ADDED
@@ -0,0 +1 @@
1
+ export {};
package/package.json ADDED
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "shivanya-ai",
3
+ "version": "0.1.1",
4
+ "description": "AI client for the Shivanya platform",
5
+ "main": "dist/index.js",
6
+ "type": "module",
7
+ "types": "dist/index.d.ts",
8
+ "files": [
9
+ "dist"
10
+ ],
11
+ "scripts": {
12
+ "build": "tsc"
13
+ },
14
+ "dependencies": {
15
+ "shivanya-core": "^1.0.0"
16
+ },
17
+ "devDependencies": {
18
+ "typescript": "^7.0.2"
19
+ },
20
+ "repository": {
21
+ "type": "module",
22
+ "url": "git+https://github.com/adityathute/shivanya-sdk.git"
23
+ },
24
+ "keywords": [
25
+ "shivanya",
26
+ "ai",
27
+ "sdk",
28
+ "typescript",
29
+ "api",
30
+ "chat"
31
+ ],
32
+ "author": "Aditya Thute",
33
+ "license": "ISC",
34
+ "publishConfig": {
35
+ "access": "public"
36
+ }
37
+ }