@umituz/react-native-ai-groq-provider 1.0.3 → 1.0.5
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/domain/entities/error.types.d.ts +34 -0
- package/dist/domain/entities/error.types.d.ts.map +1 -0
- package/dist/domain/entities/error.types.js +57 -0
- package/dist/domain/entities/error.types.js.map +1 -0
- package/dist/domain/entities/groq.types.d.ts +222 -0
- package/dist/domain/entities/groq.types.d.ts.map +1 -0
- package/dist/domain/entities/groq.types.js +37 -0
- package/dist/domain/entities/groq.types.js.map +1 -0
- package/dist/domain/entities/index.d.ts +7 -0
- package/dist/domain/entities/index.d.ts.map +1 -0
- package/dist/domain/entities/index.js +23 -0
- package/dist/domain/entities/index.js.map +1 -0
- package/dist/domain/entities/models.d.ts +50 -0
- package/dist/domain/entities/models.d.ts.map +1 -0
- package/dist/domain/entities/models.js +178 -0
- package/dist/domain/entities/models.js.map +1 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +73 -0
- package/dist/index.js.map +1 -0
- package/dist/infrastructure/services/ChatSession.d.ts +95 -0
- package/dist/infrastructure/services/ChatSession.d.ts.map +1 -0
- package/dist/infrastructure/services/ChatSession.js +177 -0
- package/dist/infrastructure/services/ChatSession.js.map +1 -0
- package/dist/infrastructure/services/GroqClient.d.ts +52 -0
- package/dist/infrastructure/services/GroqClient.d.ts.map +1 -0
- package/dist/infrastructure/services/GroqClient.js +258 -0
- package/dist/infrastructure/services/GroqClient.js.map +1 -0
- package/dist/infrastructure/services/Streaming.d.ts +27 -0
- package/dist/infrastructure/services/Streaming.d.ts.map +1 -0
- package/dist/infrastructure/services/Streaming.js +84 -0
- package/dist/infrastructure/services/Streaming.js.map +1 -0
- package/dist/infrastructure/services/StructuredText.d.ts +20 -0
- package/dist/infrastructure/services/StructuredText.d.ts.map +1 -0
- package/dist/infrastructure/services/StructuredText.js +204 -0
- package/dist/infrastructure/services/StructuredText.js.map +1 -0
- package/dist/infrastructure/services/TextGeneration.d.ts +18 -0
- package/dist/infrastructure/services/TextGeneration.d.ts.map +1 -0
- package/dist/infrastructure/services/TextGeneration.js +127 -0
- package/dist/infrastructure/services/TextGeneration.js.map +1 -0
- package/dist/infrastructure/services/index.d.ts +9 -0
- package/dist/infrastructure/services/index.d.ts.map +1 -0
- package/dist/infrastructure/services/index.js +24 -0
- package/dist/infrastructure/services/index.js.map +1 -0
- package/dist/infrastructure/telemetry/TelemetryHooks.d.ts +48 -0
- package/dist/infrastructure/telemetry/TelemetryHooks.d.ts.map +1 -0
- package/dist/infrastructure/telemetry/TelemetryHooks.js +70 -0
- package/dist/infrastructure/telemetry/TelemetryHooks.js.map +1 -0
- package/dist/infrastructure/telemetry/index.d.ts +5 -0
- package/dist/infrastructure/telemetry/index.d.ts.map +1 -0
- package/dist/infrastructure/telemetry/index.js +10 -0
- package/dist/infrastructure/telemetry/index.js.map +1 -0
- package/dist/infrastructure/utils/async/execute-state.util.d.ts +27 -0
- package/dist/infrastructure/utils/async/execute-state.util.d.ts.map +1 -0
- package/dist/infrastructure/utils/async/execute-state.util.js +50 -0
- package/dist/infrastructure/utils/async/execute-state.util.js.map +1 -0
- package/dist/infrastructure/utils/async/index.d.ts +6 -0
- package/dist/infrastructure/utils/async/index.d.ts.map +1 -0
- package/dist/infrastructure/utils/async/index.js +10 -0
- package/dist/infrastructure/utils/async/index.js.map +1 -0
- package/dist/infrastructure/utils/content-mapper.util.d.ts +34 -0
- package/dist/infrastructure/utils/content-mapper.util.d.ts.map +1 -0
- package/dist/infrastructure/utils/content-mapper.util.js +84 -0
- package/dist/infrastructure/utils/content-mapper.util.js.map +1 -0
- package/dist/infrastructure/utils/error-mapper.util.d.ts +21 -0
- package/dist/infrastructure/utils/error-mapper.util.d.ts.map +1 -0
- package/dist/infrastructure/utils/error-mapper.util.js +73 -0
- package/dist/infrastructure/utils/error-mapper.util.js.map +1 -0
- package/dist/infrastructure/utils/index.d.ts +7 -0
- package/dist/infrastructure/utils/index.d.ts.map +1 -0
- package/dist/infrastructure/utils/index.js +23 -0
- package/dist/infrastructure/utils/index.js.map +1 -0
- package/dist/presentation/hooks/useGroq.d.ts +42 -0
- package/dist/presentation/hooks/useGroq.d.ts.map +1 -0
- package/dist/presentation/hooks/useGroq.js +153 -0
- package/dist/presentation/hooks/useGroq.js.map +1 -0
- package/dist/presentation/hooks/useOperationManager.d.ts +34 -0
- package/dist/presentation/hooks/useOperationManager.d.ts.map +1 -0
- package/dist/presentation/hooks/useOperationManager.js +76 -0
- package/dist/presentation/hooks/useOperationManager.js.map +1 -0
- package/dist/providers/ConfigBuilder.d.ts +86 -0
- package/dist/providers/ConfigBuilder.d.ts.map +1 -0
- package/dist/providers/ConfigBuilder.js +147 -0
- package/dist/providers/ConfigBuilder.js.map +1 -0
- package/dist/providers/ProviderFactory.d.ts +56 -0
- package/dist/providers/ProviderFactory.d.ts.map +1 -0
- package/dist/providers/ProviderFactory.js +75 -0
- package/dist/providers/ProviderFactory.js.map +1 -0
- package/dist/providers/index.d.ts +7 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/providers/index.js +15 -0
- package/dist/providers/index.js.map +1 -0
- package/package.json +1 -1
- package/src/infrastructure/services/GroqClient.ts +61 -1
- package/src/infrastructure/services/StructuredText.ts +94 -1
- package/src/infrastructure/services/TextGeneration.ts +70 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom error class for Groq operations
|
|
3
|
+
*/
|
|
4
|
+
export declare class GroqError extends Error {
|
|
5
|
+
type: GroqErrorType;
|
|
6
|
+
cause?: unknown;
|
|
7
|
+
constructor(type: GroqErrorType, message: string, cause?: unknown);
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Error types for Groq operations
|
|
11
|
+
*/
|
|
12
|
+
export declare enum GroqErrorType {
|
|
13
|
+
/** API key is missing or invalid */
|
|
14
|
+
INVALID_API_KEY = "INVALID_API_KEY",
|
|
15
|
+
/** Configuration is missing or invalid */
|
|
16
|
+
MISSING_CONFIG = "MISSING_CONFIG",
|
|
17
|
+
/** Network error occurred */
|
|
18
|
+
NETWORK_ERROR = "NETWORK_ERROR",
|
|
19
|
+
/** Request was aborted */
|
|
20
|
+
ABORT_ERROR = "ABORT_ERROR",
|
|
21
|
+
/** Rate limit exceeded */
|
|
22
|
+
RATE_LIMIT_ERROR = "RATE_LIMIT_ERROR",
|
|
23
|
+
/** Insufficient quota */
|
|
24
|
+
QUOTA_EXCEEDED = "QUOTA_EXCEEDED",
|
|
25
|
+
/** Server error */
|
|
26
|
+
SERVER_ERROR = "SERVER_ERROR",
|
|
27
|
+
/** Unknown error occurred */
|
|
28
|
+
UNKNOWN_ERROR = "UNKNOWN_ERROR"
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Map HTTP status codes to error types
|
|
32
|
+
*/
|
|
33
|
+
export declare function mapHttpStatusToErrorType(status: number): GroqErrorType;
|
|
34
|
+
//# sourceMappingURL=error.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.types.d.ts","sourceRoot":"","sources":["../../../src/domain/entities/error.types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,SAAU,SAAQ,KAAK;IAEzB,IAAI,EAAE,aAAa;IAEnB,KAAK,CAAC,EAAE,OAAO;gBAFf,IAAI,EAAE,aAAa,EAC1B,OAAO,EAAE,MAAM,EACR,KAAK,CAAC,EAAE,OAAO;CAKzB;AAED;;GAEG;AACH,oBAAY,aAAa;IACvB,oCAAoC;IACpC,eAAe,oBAAoB;IACnC,0CAA0C;IAC1C,cAAc,mBAAmB;IACjC,6BAA6B;IAC7B,aAAa,kBAAkB;IAC/B,0BAA0B;IAC1B,WAAW,gBAAgB;IAC3B,0BAA0B;IAC1B,gBAAgB,qBAAqB;IACrC,yBAAyB;IACzB,cAAc,mBAAmB;IACjC,mBAAmB;IACnB,YAAY,iBAAiB;IAC7B,6BAA6B;IAC7B,aAAa,kBAAkB;CAChC;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,CActE"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GroqErrorType = exports.GroqError = void 0;
|
|
4
|
+
exports.mapHttpStatusToErrorType = mapHttpStatusToErrorType;
|
|
5
|
+
/**
|
|
6
|
+
* Custom error class for Groq operations
|
|
7
|
+
*/
|
|
8
|
+
class GroqError extends Error {
|
|
9
|
+
constructor(type, message, cause) {
|
|
10
|
+
super(message);
|
|
11
|
+
this.type = type;
|
|
12
|
+
this.cause = cause;
|
|
13
|
+
this.name = "GroqError";
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.GroqError = GroqError;
|
|
17
|
+
/**
|
|
18
|
+
* Error types for Groq operations
|
|
19
|
+
*/
|
|
20
|
+
var GroqErrorType;
|
|
21
|
+
(function (GroqErrorType) {
|
|
22
|
+
/** API key is missing or invalid */
|
|
23
|
+
GroqErrorType["INVALID_API_KEY"] = "INVALID_API_KEY";
|
|
24
|
+
/** Configuration is missing or invalid */
|
|
25
|
+
GroqErrorType["MISSING_CONFIG"] = "MISSING_CONFIG";
|
|
26
|
+
/** Network error occurred */
|
|
27
|
+
GroqErrorType["NETWORK_ERROR"] = "NETWORK_ERROR";
|
|
28
|
+
/** Request was aborted */
|
|
29
|
+
GroqErrorType["ABORT_ERROR"] = "ABORT_ERROR";
|
|
30
|
+
/** Rate limit exceeded */
|
|
31
|
+
GroqErrorType["RATE_LIMIT_ERROR"] = "RATE_LIMIT_ERROR";
|
|
32
|
+
/** Insufficient quota */
|
|
33
|
+
GroqErrorType["QUOTA_EXCEEDED"] = "QUOTA_EXCEEDED";
|
|
34
|
+
/** Server error */
|
|
35
|
+
GroqErrorType["SERVER_ERROR"] = "SERVER_ERROR";
|
|
36
|
+
/** Unknown error occurred */
|
|
37
|
+
GroqErrorType["UNKNOWN_ERROR"] = "UNKNOWN_ERROR";
|
|
38
|
+
})(GroqErrorType || (exports.GroqErrorType = GroqErrorType = {}));
|
|
39
|
+
/**
|
|
40
|
+
* Map HTTP status codes to error types
|
|
41
|
+
*/
|
|
42
|
+
function mapHttpStatusToErrorType(status) {
|
|
43
|
+
if (status === 401 || status === 403) {
|
|
44
|
+
return GroqErrorType.INVALID_API_KEY;
|
|
45
|
+
}
|
|
46
|
+
if (status === 429) {
|
|
47
|
+
return GroqErrorType.RATE_LIMIT_ERROR;
|
|
48
|
+
}
|
|
49
|
+
if (status >= 500 && status < 600) {
|
|
50
|
+
return GroqErrorType.SERVER_ERROR;
|
|
51
|
+
}
|
|
52
|
+
if (status >= 400 && status < 500) {
|
|
53
|
+
return GroqErrorType.INVALID_API_KEY;
|
|
54
|
+
}
|
|
55
|
+
return GroqErrorType.UNKNOWN_ERROR;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=error.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.types.js","sourceRoot":"","sources":["../../../src/domain/entities/error.types.ts"],"names":[],"mappings":";;;AAuCA,4DAcC;AArDD;;GAEG;AACH,MAAa,SAAU,SAAQ,KAAK;IAClC,YACS,IAAmB,EAC1B,OAAe,EACR,KAAe;QAEtB,KAAK,CAAC,OAAO,CAAC,CAAC;QAJR,SAAI,GAAJ,IAAI,CAAe;QAEnB,UAAK,GAAL,KAAK,CAAU;QAGtB,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC;IAC1B,CAAC;CACF;AATD,8BASC;AAED;;GAEG;AACH,IAAY,aAiBX;AAjBD,WAAY,aAAa;IACvB,oCAAoC;IACpC,oDAAmC,CAAA;IACnC,0CAA0C;IAC1C,kDAAiC,CAAA;IACjC,6BAA6B;IAC7B,gDAA+B,CAAA;IAC/B,0BAA0B;IAC1B,4CAA2B,CAAA;IAC3B,0BAA0B;IAC1B,sDAAqC,CAAA;IACrC,yBAAyB;IACzB,kDAAiC,CAAA;IACjC,mBAAmB;IACnB,8CAA6B,CAAA;IAC7B,6BAA6B;IAC7B,gDAA+B,CAAA;AACjC,CAAC,EAjBW,aAAa,6BAAb,aAAa,QAiBxB;AAED;;GAEG;AACH,SAAgB,wBAAwB,CAAC,MAAc;IACrD,IAAI,MAAM,KAAK,GAAG,IAAI,MAAM,KAAK,GAAG,EAAE,CAAC;QACrC,OAAO,aAAa,CAAC,eAAe,CAAC;IACvC,CAAC;IACD,IAAI,MAAM,KAAK,GAAG,EAAE,CAAC;QACnB,OAAO,aAAa,CAAC,gBAAgB,CAAC;IACxC,CAAC;IACD,IAAI,MAAM,IAAI,GAAG,IAAI,MAAM,GAAG,GAAG,EAAE,CAAC;QAClC,OAAO,aAAa,CAAC,YAAY,CAAC;IACpC,CAAC;IACD,IAAI,MAAM,IAAI,GAAG,IAAI,MAAM,GAAG,GAAG,EAAE,CAAC;QAClC,OAAO,aAAa,CAAC,eAAe,CAAC;IACvC,CAAC;IACD,OAAO,aAAa,CAAC,aAAa,CAAC;AACrC,CAAC"}
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration for Groq client initialization
|
|
3
|
+
*/
|
|
4
|
+
export interface GroqConfig {
|
|
5
|
+
/** API key for authentication */
|
|
6
|
+
apiKey: string;
|
|
7
|
+
/** Base URL for API requests (default: https://api.groq.com/openai/v1) */
|
|
8
|
+
baseUrl?: string;
|
|
9
|
+
/** Default timeout in milliseconds */
|
|
10
|
+
timeoutMs?: number;
|
|
11
|
+
/** Default model to use for text generation */
|
|
12
|
+
textModel?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Generation configuration for AI requests
|
|
16
|
+
*/
|
|
17
|
+
export interface GroqGenerationConfig {
|
|
18
|
+
/** Controls randomness (0.0 - 2.0, default: 0.7) */
|
|
19
|
+
temperature?: number;
|
|
20
|
+
/** Maximum number of tokens to generate */
|
|
21
|
+
maxTokens?: number;
|
|
22
|
+
/** Nucleus sampling threshold (0.0 - 1.0) */
|
|
23
|
+
topP?: number;
|
|
24
|
+
/** Number of completions to generate */
|
|
25
|
+
n?: number;
|
|
26
|
+
/** Stop sequences */
|
|
27
|
+
stop?: string[];
|
|
28
|
+
/** Frequency penalty (-2.0 to 2.0) */
|
|
29
|
+
frequencyPenalty?: number;
|
|
30
|
+
/** Presence penalty (-2.0 to 2.0) */
|
|
31
|
+
presencePenalty?: number;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Message role in chat conversation
|
|
35
|
+
*/
|
|
36
|
+
export type GroqMessageRole = "system" | "user" | "assistant";
|
|
37
|
+
/**
|
|
38
|
+
* Chat message structure
|
|
39
|
+
*/
|
|
40
|
+
export interface GroqMessage {
|
|
41
|
+
/** Role of the message sender */
|
|
42
|
+
role: GroqMessageRole;
|
|
43
|
+
/** Content of the message */
|
|
44
|
+
content: string;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Chat completion request
|
|
48
|
+
*/
|
|
49
|
+
export interface GroqChatRequest {
|
|
50
|
+
/** Model to use for generation */
|
|
51
|
+
model: string;
|
|
52
|
+
/** Array of messages in the conversation */
|
|
53
|
+
messages: GroqMessage[];
|
|
54
|
+
/** Generation configuration */
|
|
55
|
+
temperature?: number;
|
|
56
|
+
max_tokens?: number;
|
|
57
|
+
top_p?: number;
|
|
58
|
+
n?: number;
|
|
59
|
+
stop?: string[];
|
|
60
|
+
frequency_penalty?: number;
|
|
61
|
+
presence_penalty?: number;
|
|
62
|
+
/** Enable streaming response */
|
|
63
|
+
stream?: boolean;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Chat completion response
|
|
67
|
+
*/
|
|
68
|
+
export interface GroqChatResponse {
|
|
69
|
+
/** Unique identifier for the response */
|
|
70
|
+
id: string;
|
|
71
|
+
/** Object type (chat.completion) */
|
|
72
|
+
object: string;
|
|
73
|
+
/** Timestamp of creation */
|
|
74
|
+
created: number;
|
|
75
|
+
/** Model used for generation */
|
|
76
|
+
model: string;
|
|
77
|
+
/** Array of completion choices */
|
|
78
|
+
choices: GroqChoice[];
|
|
79
|
+
/** Token usage information */
|
|
80
|
+
usage: GroqUsage;
|
|
81
|
+
/** System fingerprint (Groq specific) */
|
|
82
|
+
system_fingerprint?: string;
|
|
83
|
+
/** X Groq (Groq specific) */
|
|
84
|
+
x_groq?: {
|
|
85
|
+
id?: string;
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Individual completion choice
|
|
90
|
+
*/
|
|
91
|
+
export interface GroqChoice {
|
|
92
|
+
/** Index of the choice */
|
|
93
|
+
index: number;
|
|
94
|
+
/** Generated message */
|
|
95
|
+
message: {
|
|
96
|
+
role: "assistant";
|
|
97
|
+
content: string;
|
|
98
|
+
};
|
|
99
|
+
/** Reason for finish (stop, length, etc.) */
|
|
100
|
+
finish_reason: GroqFinishReason;
|
|
101
|
+
/** Logprobs (optional) */
|
|
102
|
+
logprobs: null | object;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Finish reason types
|
|
106
|
+
*/
|
|
107
|
+
export type GroqFinishReason = "stop" | "length" | "content_filter";
|
|
108
|
+
/**
|
|
109
|
+
* Token usage information
|
|
110
|
+
*/
|
|
111
|
+
export interface GroqUsage {
|
|
112
|
+
/** Number of tokens in the prompt */
|
|
113
|
+
prompt_tokens: number;
|
|
114
|
+
/** Number of tokens in the completion */
|
|
115
|
+
completion_tokens: number;
|
|
116
|
+
/** Total number of tokens used */
|
|
117
|
+
total_tokens: number;
|
|
118
|
+
/** Prompt time (Groq specific) */
|
|
119
|
+
prompt_time?: number;
|
|
120
|
+
/** Completion time (Groq specific) */
|
|
121
|
+
completion_time?: number;
|
|
122
|
+
/** Total time (Groq specific) */
|
|
123
|
+
total_time?: number;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Streaming chunk response
|
|
127
|
+
*/
|
|
128
|
+
export interface GroqChatChunk {
|
|
129
|
+
/** Unique identifier for the response */
|
|
130
|
+
id: string;
|
|
131
|
+
/** Object type (chat.completion.chunk) */
|
|
132
|
+
object: string;
|
|
133
|
+
/** Timestamp of creation */
|
|
134
|
+
created: number;
|
|
135
|
+
/** Model used for generation */
|
|
136
|
+
model: string;
|
|
137
|
+
/** Array of completion choices */
|
|
138
|
+
choices: GroqChunkChoice[];
|
|
139
|
+
/** System fingerprint (Groq specific) */
|
|
140
|
+
system_fingerprint?: string;
|
|
141
|
+
/** X Groq (Groq specific) */
|
|
142
|
+
x_groq?: {
|
|
143
|
+
id?: string;
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Individual chunk choice for streaming
|
|
148
|
+
*/
|
|
149
|
+
export interface GroqChunkChoice {
|
|
150
|
+
/** Index of the choice */
|
|
151
|
+
index: number;
|
|
152
|
+
/** Delta message (partial content) */
|
|
153
|
+
delta: {
|
|
154
|
+
role?: "assistant";
|
|
155
|
+
content?: string;
|
|
156
|
+
};
|
|
157
|
+
/** Reason for finish (null if not finished) */
|
|
158
|
+
finish_reason: GroqFinishReason | null;
|
|
159
|
+
/** Logprobs (optional) */
|
|
160
|
+
logprobs: null | object;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* API error response
|
|
164
|
+
*/
|
|
165
|
+
export interface GroqErrorResponse {
|
|
166
|
+
/** Error type */
|
|
167
|
+
error: {
|
|
168
|
+
/** Error message */
|
|
169
|
+
message: string;
|
|
170
|
+
/** Error type */
|
|
171
|
+
type: string;
|
|
172
|
+
/** Error code */
|
|
173
|
+
code?: string;
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Configuration for a chat session
|
|
178
|
+
*/
|
|
179
|
+
export interface GroqChatConfig {
|
|
180
|
+
/** Model name override */
|
|
181
|
+
model?: string;
|
|
182
|
+
/** System instruction for the model */
|
|
183
|
+
systemInstruction?: string;
|
|
184
|
+
/** Generation config (temperature, maxTokens, etc.) */
|
|
185
|
+
generationConfig?: GroqGenerationConfig;
|
|
186
|
+
/** Initial conversation history */
|
|
187
|
+
history?: GroqMessage[];
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Available Groq models
|
|
191
|
+
*/
|
|
192
|
+
export declare const GROQ_MODELS: {
|
|
193
|
+
/** Llama 3.1 8B - Fast and efficient (560 T/s) */
|
|
194
|
+
readonly LLAMA_3_1_8B_INSTANT: "llama-3.1-8b-instant";
|
|
195
|
+
/** Llama 3.3 70B - Versatile and powerful (280 T/s) */
|
|
196
|
+
readonly LLAMA_3_3_70B_VERSATILE: "llama-3.3-70b-versatile";
|
|
197
|
+
/** Llama 3.1 70B - Versatile (280 T/s) */
|
|
198
|
+
readonly LLAMA_3_1_70B_VERSATILE: "llama-3.1-70b-versatile";
|
|
199
|
+
/** GPT-OSS 20B - Experimental (1000 T/s) */
|
|
200
|
+
readonly GPT_OSS_20B: "openai/gpt-oss-20b";
|
|
201
|
+
/** GPT-OSS 120B - Large experimental model */
|
|
202
|
+
readonly GPT_OSS_120B: "openai/gpt-oss-120b";
|
|
203
|
+
/** Mixtral 8x7b - MoE model */
|
|
204
|
+
readonly MIXTRAL_8X7B: "mixtral-8x7b-32768";
|
|
205
|
+
/** Gemma 2 9B - Google's model */
|
|
206
|
+
readonly GEMMA_2_9B: "gemma2-9b-it";
|
|
207
|
+
/** Llama 4 Scout 17B - New model (30K T/s) */
|
|
208
|
+
readonly LLAMA_4_SCOUT_17B: "meta-llama/llama-4-scout-17b-16e-instruct";
|
|
209
|
+
/** Kimi K2 - Moonshot AI model */
|
|
210
|
+
readonly KIMI_K2_INSTRUCT: "moonshotai/kimi-k2-instruct";
|
|
211
|
+
/** Qwen 3 32B - Alibaba's model */
|
|
212
|
+
readonly QWEN3_32B: "qwen/qwen3-32b";
|
|
213
|
+
};
|
|
214
|
+
/**
|
|
215
|
+
* Default models for different use cases
|
|
216
|
+
*/
|
|
217
|
+
export declare const DEFAULT_MODELS: {
|
|
218
|
+
readonly TEXT: "llama-3.1-8b-instant";
|
|
219
|
+
readonly FAST: "llama-3.1-8b-instant";
|
|
220
|
+
readonly EXPERIMENTAL: "openai/gpt-oss-20b";
|
|
221
|
+
};
|
|
222
|
+
//# sourceMappingURL=groq.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"groq.types.d.ts","sourceRoot":"","sources":["../../../src/domain/entities/groq.types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,iCAAiC;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,0EAA0E;IAC1E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sCAAsC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+CAA+C;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,oDAAoD;IACpD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2CAA2C;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6CAA6C;IAC7C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wCAAwC;IACxC,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,qBAAqB;IACrB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,sCAAsC;IACtC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,qCAAqC;IACrC,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,MAAM,GAAG,WAAW,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,iCAAiC;IACjC,IAAI,EAAE,eAAe,CAAC;IACtB,6BAA6B;IAC7B,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,kCAAkC;IAClC,KAAK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BAAiB;QACjB,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,0BAA0B;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uCAAuC;IACvC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,uDAAuD;IACvD,gBAAgB,CAAC,EAAE,oBAAoB,CAAC;IACxC,mCAAmC;IACnC,OAAO,CAAC,EAAE,WAAW,EAAE,CAAC;CACzB;AAED;;GAEG;AACH,eAAO,MAAM,WAAW;IACtB,kDAAkD;;IAElD,uDAAuD;;IAEvD,0CAA0C;;IAE1C,4CAA4C;;IAE5C,8CAA8C;;IAE9C,+BAA+B;;IAE/B,kCAAkC;;IAElC,8CAA8C;;IAE9C,kCAAkC;;IAElC,mCAAmC;;CAE3B,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,cAAc;;;;CAIjB,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_MODELS = exports.GROQ_MODELS = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Available Groq models
|
|
6
|
+
*/
|
|
7
|
+
exports.GROQ_MODELS = {
|
|
8
|
+
/** Llama 3.1 8B - Fast and efficient (560 T/s) */
|
|
9
|
+
LLAMA_3_1_8B_INSTANT: "llama-3.1-8b-instant",
|
|
10
|
+
/** Llama 3.3 70B - Versatile and powerful (280 T/s) */
|
|
11
|
+
LLAMA_3_3_70B_VERSATILE: "llama-3.3-70b-versatile",
|
|
12
|
+
/** Llama 3.1 70B - Versatile (280 T/s) */
|
|
13
|
+
LLAMA_3_1_70B_VERSATILE: "llama-3.1-70b-versatile",
|
|
14
|
+
/** GPT-OSS 20B - Experimental (1000 T/s) */
|
|
15
|
+
GPT_OSS_20B: "openai/gpt-oss-20b",
|
|
16
|
+
/** GPT-OSS 120B - Large experimental model */
|
|
17
|
+
GPT_OSS_120B: "openai/gpt-oss-120b",
|
|
18
|
+
/** Mixtral 8x7b - MoE model */
|
|
19
|
+
MIXTRAL_8X7B: "mixtral-8x7b-32768",
|
|
20
|
+
/** Gemma 2 9B - Google's model */
|
|
21
|
+
GEMMA_2_9B: "gemma2-9b-it",
|
|
22
|
+
/** Llama 4 Scout 17B - New model (30K T/s) */
|
|
23
|
+
LLAMA_4_SCOUT_17B: "meta-llama/llama-4-scout-17b-16e-instruct",
|
|
24
|
+
/** Kimi K2 - Moonshot AI model */
|
|
25
|
+
KIMI_K2_INSTRUCT: "moonshotai/kimi-k2-instruct",
|
|
26
|
+
/** Qwen 3 32B - Alibaba's model */
|
|
27
|
+
QWEN3_32B: "qwen/qwen3-32b",
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Default models for different use cases
|
|
31
|
+
*/
|
|
32
|
+
exports.DEFAULT_MODELS = {
|
|
33
|
+
TEXT: exports.GROQ_MODELS.LLAMA_3_1_8B_INSTANT,
|
|
34
|
+
FAST: exports.GROQ_MODELS.LLAMA_3_1_8B_INSTANT,
|
|
35
|
+
EXPERIMENTAL: exports.GROQ_MODELS.GPT_OSS_20B,
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=groq.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"groq.types.js","sourceRoot":"","sources":["../../../src/domain/entities/groq.types.ts"],"names":[],"mappings":";;;AAyMA;;GAEG;AACU,QAAA,WAAW,GAAG;IACzB,kDAAkD;IAClD,oBAAoB,EAAE,sBAAsB;IAC5C,uDAAuD;IACvD,uBAAuB,EAAE,yBAAyB;IAClD,0CAA0C;IAC1C,uBAAuB,EAAE,yBAAyB;IAClD,4CAA4C;IAC5C,WAAW,EAAE,oBAAoB;IACjC,8CAA8C;IAC9C,YAAY,EAAE,qBAAqB;IACnC,+BAA+B;IAC/B,YAAY,EAAE,oBAAoB;IAClC,kCAAkC;IAClC,UAAU,EAAE,cAAc;IAC1B,8CAA8C;IAC9C,iBAAiB,EAAE,2CAA2C;IAC9D,kCAAkC;IAClC,gBAAgB,EAAE,6BAA6B;IAC/C,mCAAmC;IACnC,SAAS,EAAE,gBAAgB;CACnB,CAAC;AAEX;;GAEG;AACU,QAAA,cAAc,GAAG;IAC5B,IAAI,EAAE,mBAAW,CAAC,oBAAoB;IACtC,IAAI,EAAE,mBAAW,CAAC,oBAAoB;IACtC,YAAY,EAAE,mBAAW,CAAC,WAAW;CAC7B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/domain/entities/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Domain Entities
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
17
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
__exportStar(require("./groq.types"), exports);
|
|
21
|
+
__exportStar(require("./models"), exports);
|
|
22
|
+
__exportStar(require("./error.types"), exports);
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/domain/entities/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;AAEH,+CAA6B;AAC7B,2CAAyB;AACzB,gDAA8B"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Model Types and Configurations
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Model capabilities
|
|
6
|
+
*/
|
|
7
|
+
export interface ModelCapabilities {
|
|
8
|
+
/** Supports streaming */
|
|
9
|
+
streaming: boolean;
|
|
10
|
+
/** Supports function calling */
|
|
11
|
+
functionCalling: boolean;
|
|
12
|
+
/** Supports vision */
|
|
13
|
+
vision: boolean;
|
|
14
|
+
/** Maximum context length */
|
|
15
|
+
maxContextLength: number;
|
|
16
|
+
/** Supports system instructions */
|
|
17
|
+
systemInstructions: boolean;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Model information
|
|
21
|
+
*/
|
|
22
|
+
export interface ModelInfo {
|
|
23
|
+
/** Model ID */
|
|
24
|
+
id: string;
|
|
25
|
+
/** Display name */
|
|
26
|
+
name: string;
|
|
27
|
+
/** Model capabilities */
|
|
28
|
+
capabilities: ModelCapabilities;
|
|
29
|
+
/** Recommended temperature range */
|
|
30
|
+
temperatureRange: [number, number];
|
|
31
|
+
/** Speed in tokens/second */
|
|
32
|
+
speed?: number;
|
|
33
|
+
/** Cost per 1M tokens (input) */
|
|
34
|
+
costPerInput?: number;
|
|
35
|
+
/** Cost per 1M tokens (output) */
|
|
36
|
+
costPerOutput?: number;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Model registry with capabilities
|
|
40
|
+
*/
|
|
41
|
+
export declare const MODEL_REGISTRY: Record<string, ModelInfo>;
|
|
42
|
+
/**
|
|
43
|
+
* Get model information
|
|
44
|
+
*/
|
|
45
|
+
export declare function getModelInfo(modelId: string): ModelInfo | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* Check if model supports a capability
|
|
48
|
+
*/
|
|
49
|
+
export declare function modelSupports(modelId: string, capability: keyof ModelCapabilities): boolean;
|
|
50
|
+
//# sourceMappingURL=models.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../src/domain/entities/models.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,yBAAyB;IACzB,SAAS,EAAE,OAAO,CAAC;IACnB,gCAAgC;IAChC,eAAe,EAAE,OAAO,CAAC;IACzB,sBAAsB;IACtB,MAAM,EAAE,OAAO,CAAC;IAChB,6BAA6B;IAC7B,gBAAgB,EAAE,MAAM,CAAC;IACzB,mCAAmC;IACnC,kBAAkB,EAAE,OAAO,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,eAAe;IACf,EAAE,EAAE,MAAM,CAAC;IACX,mBAAmB;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,yBAAyB;IACzB,YAAY,EAAE,iBAAiB,CAAC;IAChC,oCAAoC;IACpC,gBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,6BAA6B;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iCAAiC;IACjC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kCAAkC;IAClC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAuJpD,CAAC;AAEF;;GAEG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAEnE;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,iBAAiB,GAAG,OAAO,CAG3F"}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Model Types and Configurations
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.MODEL_REGISTRY = void 0;
|
|
7
|
+
exports.getModelInfo = getModelInfo;
|
|
8
|
+
exports.modelSupports = modelSupports;
|
|
9
|
+
const groq_types_1 = require("./groq.types");
|
|
10
|
+
/**
|
|
11
|
+
* Model registry with capabilities
|
|
12
|
+
*/
|
|
13
|
+
exports.MODEL_REGISTRY = {
|
|
14
|
+
[groq_types_1.GROQ_MODELS.LLAMA_3_1_8B_INSTANT]: {
|
|
15
|
+
id: groq_types_1.GROQ_MODELS.LLAMA_3_1_8B_INSTANT,
|
|
16
|
+
name: "Llama 3.1 8B Instant",
|
|
17
|
+
capabilities: {
|
|
18
|
+
streaming: true,
|
|
19
|
+
functionCalling: true,
|
|
20
|
+
vision: false,
|
|
21
|
+
maxContextLength: 131072,
|
|
22
|
+
systemInstructions: true,
|
|
23
|
+
},
|
|
24
|
+
temperatureRange: [0.0, 2.0],
|
|
25
|
+
speed: 560,
|
|
26
|
+
costPerInput: 0.05,
|
|
27
|
+
costPerOutput: 0.08,
|
|
28
|
+
},
|
|
29
|
+
[groq_types_1.GROQ_MODELS.LLAMA_3_3_70B_VERSATILE]: {
|
|
30
|
+
id: groq_types_1.GROQ_MODELS.LLAMA_3_3_70B_VERSATILE,
|
|
31
|
+
name: "Llama 3.3 70B Versatile",
|
|
32
|
+
capabilities: {
|
|
33
|
+
streaming: true,
|
|
34
|
+
functionCalling: true,
|
|
35
|
+
vision: false,
|
|
36
|
+
maxContextLength: 131072,
|
|
37
|
+
systemInstructions: true,
|
|
38
|
+
},
|
|
39
|
+
temperatureRange: [0.0, 2.0],
|
|
40
|
+
speed: 280,
|
|
41
|
+
costPerInput: 0.59,
|
|
42
|
+
costPerOutput: 0.79,
|
|
43
|
+
},
|
|
44
|
+
[groq_types_1.GROQ_MODELS.LLAMA_3_1_70B_VERSATILE]: {
|
|
45
|
+
id: groq_types_1.GROQ_MODELS.LLAMA_3_1_70B_VERSATILE,
|
|
46
|
+
name: "Llama 3.1 70B Versatile",
|
|
47
|
+
capabilities: {
|
|
48
|
+
streaming: true,
|
|
49
|
+
functionCalling: true,
|
|
50
|
+
vision: false,
|
|
51
|
+
maxContextLength: 131072,
|
|
52
|
+
systemInstructions: true,
|
|
53
|
+
},
|
|
54
|
+
temperatureRange: [0.0, 2.0],
|
|
55
|
+
speed: 280,
|
|
56
|
+
costPerInput: 0.59,
|
|
57
|
+
costPerOutput: 0.79,
|
|
58
|
+
},
|
|
59
|
+
[groq_types_1.GROQ_MODELS.GPT_OSS_20B]: {
|
|
60
|
+
id: groq_types_1.GROQ_MODELS.GPT_OSS_20B,
|
|
61
|
+
name: "GPT-OSS 20B",
|
|
62
|
+
capabilities: {
|
|
63
|
+
streaming: true,
|
|
64
|
+
functionCalling: true,
|
|
65
|
+
vision: false,
|
|
66
|
+
maxContextLength: 131072,
|
|
67
|
+
systemInstructions: true,
|
|
68
|
+
},
|
|
69
|
+
temperatureRange: [0.0, 2.0],
|
|
70
|
+
speed: 1000,
|
|
71
|
+
costPerInput: 0.075,
|
|
72
|
+
costPerOutput: 0.30,
|
|
73
|
+
},
|
|
74
|
+
[groq_types_1.GROQ_MODELS.GPT_OSS_120B]: {
|
|
75
|
+
id: groq_types_1.GROQ_MODELS.GPT_OSS_120B,
|
|
76
|
+
name: "GPT-OSS 120B",
|
|
77
|
+
capabilities: {
|
|
78
|
+
streaming: true,
|
|
79
|
+
functionCalling: true,
|
|
80
|
+
vision: false,
|
|
81
|
+
maxContextLength: 131072,
|
|
82
|
+
systemInstructions: true,
|
|
83
|
+
},
|
|
84
|
+
temperatureRange: [0.0, 2.0],
|
|
85
|
+
speed: 400,
|
|
86
|
+
costPerInput: 0.40,
|
|
87
|
+
costPerOutput: 0.40,
|
|
88
|
+
},
|
|
89
|
+
[groq_types_1.GROQ_MODELS.MIXTRAL_8X7B]: {
|
|
90
|
+
id: groq_types_1.GROQ_MODELS.MIXTRAL_8X7B,
|
|
91
|
+
name: "Mixtral 8x7B",
|
|
92
|
+
capabilities: {
|
|
93
|
+
streaming: true,
|
|
94
|
+
functionCalling: true,
|
|
95
|
+
vision: false,
|
|
96
|
+
maxContextLength: 32768,
|
|
97
|
+
systemInstructions: true,
|
|
98
|
+
},
|
|
99
|
+
temperatureRange: [0.0, 2.0],
|
|
100
|
+
speed: 250,
|
|
101
|
+
costPerInput: 0.27,
|
|
102
|
+
costPerOutput: 0.27,
|
|
103
|
+
},
|
|
104
|
+
[groq_types_1.GROQ_MODELS.GEMMA_2_9B]: {
|
|
105
|
+
id: groq_types_1.GROQ_MODELS.GEMMA_2_9B,
|
|
106
|
+
name: "Gemma 2 9B IT",
|
|
107
|
+
capabilities: {
|
|
108
|
+
streaming: true,
|
|
109
|
+
functionCalling: true,
|
|
110
|
+
vision: false,
|
|
111
|
+
maxContextLength: 131072,
|
|
112
|
+
systemInstructions: true,
|
|
113
|
+
},
|
|
114
|
+
temperatureRange: [0.0, 2.0],
|
|
115
|
+
speed: 450,
|
|
116
|
+
costPerInput: 0.20,
|
|
117
|
+
costPerOutput: 0.20,
|
|
118
|
+
},
|
|
119
|
+
[groq_types_1.GROQ_MODELS.LLAMA_4_SCOUT_17B]: {
|
|
120
|
+
id: groq_types_1.GROQ_MODELS.LLAMA_4_SCOUT_17B,
|
|
121
|
+
name: "Llama 4 Scout 17B",
|
|
122
|
+
capabilities: {
|
|
123
|
+
streaming: true,
|
|
124
|
+
functionCalling: true,
|
|
125
|
+
vision: false,
|
|
126
|
+
maxContextLength: 131072,
|
|
127
|
+
systemInstructions: true,
|
|
128
|
+
},
|
|
129
|
+
temperatureRange: [0.0, 2.0],
|
|
130
|
+
speed: 30,
|
|
131
|
+
costPerInput: 0.15,
|
|
132
|
+
costPerOutput: 0.15,
|
|
133
|
+
},
|
|
134
|
+
[groq_types_1.GROQ_MODELS.KIMI_K2_INSTRUCT]: {
|
|
135
|
+
id: groq_types_1.GROQ_MODELS.KIMI_K2_INSTRUCT,
|
|
136
|
+
name: "Kimi K2 Instruct",
|
|
137
|
+
capabilities: {
|
|
138
|
+
streaming: true,
|
|
139
|
+
functionCalling: true,
|
|
140
|
+
vision: false,
|
|
141
|
+
maxContextLength: 131072,
|
|
142
|
+
systemInstructions: true,
|
|
143
|
+
},
|
|
144
|
+
temperatureRange: [0.0, 2.0],
|
|
145
|
+
speed: 60,
|
|
146
|
+
costPerInput: 0.12,
|
|
147
|
+
costPerOutput: 0.12,
|
|
148
|
+
},
|
|
149
|
+
[groq_types_1.GROQ_MODELS.QWEN3_32B]: {
|
|
150
|
+
id: groq_types_1.GROQ_MODELS.QWEN3_32B,
|
|
151
|
+
name: "Qwen 3 32B",
|
|
152
|
+
capabilities: {
|
|
153
|
+
streaming: true,
|
|
154
|
+
functionCalling: true,
|
|
155
|
+
vision: false,
|
|
156
|
+
maxContextLength: 131072,
|
|
157
|
+
systemInstructions: true,
|
|
158
|
+
},
|
|
159
|
+
temperatureRange: [0.0, 2.0],
|
|
160
|
+
speed: 60,
|
|
161
|
+
costPerInput: 0.10,
|
|
162
|
+
costPerOutput: 0.10,
|
|
163
|
+
},
|
|
164
|
+
};
|
|
165
|
+
/**
|
|
166
|
+
* Get model information
|
|
167
|
+
*/
|
|
168
|
+
function getModelInfo(modelId) {
|
|
169
|
+
return exports.MODEL_REGISTRY[modelId];
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Check if model supports a capability
|
|
173
|
+
*/
|
|
174
|
+
function modelSupports(modelId, capability) {
|
|
175
|
+
const info = getModelInfo(modelId);
|
|
176
|
+
return Boolean(info?.capabilities[capability]);
|
|
177
|
+
}
|
|
178
|
+
//# sourceMappingURL=models.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../../src/domain/entities/models.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAuMH,oCAEC;AAKD,sCAGC;AA/MD,6CAA2C;AAsC3C;;GAEG;AACU,QAAA,cAAc,GAA8B;IACvD,CAAC,wBAAW,CAAC,oBAAoB,CAAC,EAAE;QAClC,EAAE,EAAE,wBAAW,CAAC,oBAAoB;QACpC,IAAI,EAAE,sBAAsB;QAC5B,YAAY,EAAE;YACZ,SAAS,EAAE,IAAI;YACf,eAAe,EAAE,IAAI;YACrB,MAAM,EAAE,KAAK;YACb,gBAAgB,EAAE,MAAM;YACxB,kBAAkB,EAAE,IAAI;SACzB;QACD,gBAAgB,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC;QAC5B,KAAK,EAAE,GAAG;QACV,YAAY,EAAE,IAAI;QAClB,aAAa,EAAE,IAAI;KACpB;IACD,CAAC,wBAAW,CAAC,uBAAuB,CAAC,EAAE;QACrC,EAAE,EAAE,wBAAW,CAAC,uBAAuB;QACvC,IAAI,EAAE,yBAAyB;QAC/B,YAAY,EAAE;YACZ,SAAS,EAAE,IAAI;YACf,eAAe,EAAE,IAAI;YACrB,MAAM,EAAE,KAAK;YACb,gBAAgB,EAAE,MAAM;YACxB,kBAAkB,EAAE,IAAI;SACzB;QACD,gBAAgB,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC;QAC5B,KAAK,EAAE,GAAG;QACV,YAAY,EAAE,IAAI;QAClB,aAAa,EAAE,IAAI;KACpB;IACD,CAAC,wBAAW,CAAC,uBAAuB,CAAC,EAAE;QACrC,EAAE,EAAE,wBAAW,CAAC,uBAAuB;QACvC,IAAI,EAAE,yBAAyB;QAC/B,YAAY,EAAE;YACZ,SAAS,EAAE,IAAI;YACf,eAAe,EAAE,IAAI;YACrB,MAAM,EAAE,KAAK;YACb,gBAAgB,EAAE,MAAM;YACxB,kBAAkB,EAAE,IAAI;SACzB;QACD,gBAAgB,EAAE,C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