@cinemashel/contracts 1.0.7 → 1.0.8
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/gen/ai.ts +48 -0
- package/package.json +1 -1
- package/proto/ai.proto +17 -0
package/gen/ai.ts
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.6
|
|
4
|
+
// protoc v3.21.12
|
|
5
|
+
// source: ai.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
|
+
import { Observable } from "rxjs";
|
|
10
|
+
|
|
11
|
+
export const protobufPackage = "ai.v1";
|
|
12
|
+
|
|
13
|
+
export interface ChatRequest {
|
|
14
|
+
prompt: string;
|
|
15
|
+
conversationId: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface ChatResponse {
|
|
19
|
+
message: string;
|
|
20
|
+
success: boolean;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const AI_V1_PACKAGE_NAME = "ai.v1";
|
|
24
|
+
|
|
25
|
+
export interface AiServiceClient {
|
|
26
|
+
chat(request: ChatRequest): Observable<ChatResponse>;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface AiServiceController {
|
|
30
|
+
chat(request: ChatRequest): Promise<ChatResponse> | Observable<ChatResponse> | ChatResponse;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function AiServiceControllerMethods() {
|
|
34
|
+
return function (constructor: Function) {
|
|
35
|
+
const grpcMethods: string[] = ["chat"];
|
|
36
|
+
for (const method of grpcMethods) {
|
|
37
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
38
|
+
GrpcMethod("AiService", method)(constructor.prototype[method], method, descriptor);
|
|
39
|
+
}
|
|
40
|
+
const grpcStreamMethods: string[] = [];
|
|
41
|
+
for (const method of grpcStreamMethods) {
|
|
42
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
43
|
+
GrpcStreamMethod("AiService", method)(constructor.prototype[method], method, descriptor);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export const AI_SERVICE_NAME = "AiService";
|
package/package.json
CHANGED
package/proto/ai.proto
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package ai.v1;
|
|
4
|
+
|
|
5
|
+
service AiService {
|
|
6
|
+
rpc Chat (ChatRequest) returns (ChatResponse);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
message ChatRequest {
|
|
10
|
+
string prompt = 1;
|
|
11
|
+
string conversation_id = 2;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
message ChatResponse {
|
|
15
|
+
string message = 1;
|
|
16
|
+
bool success = 2;
|
|
17
|
+
}
|