190proof 1.0.2 → 1.0.4
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/index.d.mts +7 -2
- package/dist/index.d.ts +7 -2
- package/dist/index.js +11 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -67,10 +67,15 @@ interface OpenAIConfig {
|
|
|
67
67
|
interface AnthropicAIConfig {
|
|
68
68
|
service: "anthropic" | "bedrock";
|
|
69
69
|
}
|
|
70
|
+
interface FunctionDefinition {
|
|
71
|
+
name: string;
|
|
72
|
+
description: string;
|
|
73
|
+
parameters: Record<string, any>;
|
|
74
|
+
}
|
|
70
75
|
interface GenericPayload {
|
|
71
76
|
model: GPTModel | ClaudeModel | GroqModel;
|
|
72
77
|
messages: GenericMessage[];
|
|
73
|
-
functions?:
|
|
78
|
+
functions?: FunctionDefinition[];
|
|
74
79
|
function_call?: "none" | "auto" | {
|
|
75
80
|
name: string;
|
|
76
81
|
};
|
|
@@ -79,4 +84,4 @@ interface GenericPayload {
|
|
|
79
84
|
|
|
80
85
|
declare function callWithRetries(identifier: string, aiPayload: GenericPayload, aiConfig?: OpenAIConfig | AnthropicAIConfig, retries?: number, chunkTimeoutMs?: number): Promise<ParsedResponseMessage>;
|
|
81
86
|
|
|
82
|
-
export { ClaudeModel, GPTModel, GroqModel, callWithRetries };
|
|
87
|
+
export { ClaudeModel, GPTModel, GroqModel, type OpenAIConfig, callWithRetries };
|
package/dist/index.d.ts
CHANGED
|
@@ -67,10 +67,15 @@ interface OpenAIConfig {
|
|
|
67
67
|
interface AnthropicAIConfig {
|
|
68
68
|
service: "anthropic" | "bedrock";
|
|
69
69
|
}
|
|
70
|
+
interface FunctionDefinition {
|
|
71
|
+
name: string;
|
|
72
|
+
description: string;
|
|
73
|
+
parameters: Record<string, any>;
|
|
74
|
+
}
|
|
70
75
|
interface GenericPayload {
|
|
71
76
|
model: GPTModel | ClaudeModel | GroqModel;
|
|
72
77
|
messages: GenericMessage[];
|
|
73
|
-
functions?:
|
|
78
|
+
functions?: FunctionDefinition[];
|
|
74
79
|
function_call?: "none" | "auto" | {
|
|
75
80
|
name: string;
|
|
76
81
|
};
|
|
@@ -79,4 +84,4 @@ interface GenericPayload {
|
|
|
79
84
|
|
|
80
85
|
declare function callWithRetries(identifier: string, aiPayload: GenericPayload, aiConfig?: OpenAIConfig | AnthropicAIConfig, retries?: number, chunkTimeoutMs?: number): Promise<ParsedResponseMessage>;
|
|
81
86
|
|
|
82
|
-
export { ClaudeModel, GPTModel, GroqModel, callWithRetries };
|
|
87
|
+
export { ClaudeModel, GPTModel, GroqModel, type OpenAIConfig, callWithRetries };
|
package/dist/index.js
CHANGED
|
@@ -31533,6 +31533,7 @@ async function callOpenAIStream(identifier, openAiPayload, openAiConfig, chunkTi
|
|
|
31533
31533
|
baseUrl: defaultOpenAIBaseUrl
|
|
31534
31534
|
};
|
|
31535
31535
|
}
|
|
31536
|
+
console.log("payload", openAiPayload);
|
|
31536
31537
|
let response;
|
|
31537
31538
|
const controller = new AbortController();
|
|
31538
31539
|
if (openAiConfig.service === "azure") {
|
|
@@ -31908,7 +31909,8 @@ function prepareOpenAIPayload(payload) {
|
|
|
31908
31909
|
content: normalizeMessageContent(message.content)
|
|
31909
31910
|
// TODO: Handle files
|
|
31910
31911
|
})),
|
|
31911
|
-
functions: payload.functions
|
|
31912
|
+
functions: payload.functions,
|
|
31913
|
+
function_call: payload.function_call
|
|
31912
31914
|
};
|
|
31913
31915
|
}
|
|
31914
31916
|
function isGroqPayload(payload) {
|
|
@@ -31922,10 +31924,15 @@ function prepareGroqPayload(payload) {
|
|
|
31922
31924
|
role: message.role,
|
|
31923
31925
|
content: normalizeMessageContent(message.content)
|
|
31924
31926
|
})),
|
|
31925
|
-
|
|
31927
|
+
tools: (_a3 = payload.functions) == null ? void 0 : _a3.map((fn) => ({
|
|
31926
31928
|
type: "function",
|
|
31927
31929
|
function: fn
|
|
31928
|
-
}))
|
|
31930
|
+
})),
|
|
31931
|
+
tool_choice: payload.function_call ? typeof payload.function_call === "string" ? payload.function_call : {
|
|
31932
|
+
type: "function",
|
|
31933
|
+
function: payload.function_call
|
|
31934
|
+
} : void 0,
|
|
31935
|
+
temperature: payload.temperature
|
|
31929
31936
|
};
|
|
31930
31937
|
}
|
|
31931
31938
|
function normalizeMessageContent(content) {
|
|
@@ -31934,11 +31941,7 @@ function normalizeMessageContent(content) {
|
|
|
31934
31941
|
async function callGroq(identifier, payload) {
|
|
31935
31942
|
const response = await axios_default.post(
|
|
31936
31943
|
"https://api.groq.com/openai/v1/chat/completions",
|
|
31937
|
-
|
|
31938
|
-
model: payload.model,
|
|
31939
|
-
messages: payload.messages,
|
|
31940
|
-
tools: payload.functions
|
|
31941
|
-
},
|
|
31944
|
+
payload,
|
|
31942
31945
|
{
|
|
31943
31946
|
headers: {
|
|
31944
31947
|
"content-type": "application/json",
|