190proof 1.0.44 → 1.0.46
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 +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +11 -20
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -20
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -27020,6 +27020,7 @@ var ClaudeModel = /* @__PURE__ */ ((ClaudeModel2) => {
|
|
|
27020
27020
|
ClaudeModel2["HAIKU"] = "claude-3-haiku-20240307";
|
|
27021
27021
|
ClaudeModel2["SONNET"] = "claude-3-sonnet-20240229";
|
|
27022
27022
|
ClaudeModel2["OPUS"] = "claude-3-opus-20240229";
|
|
27023
|
+
ClaudeModel2["SONNET_3_5"] = "claude-3-5-sonnet-20240620";
|
|
27023
27024
|
return ClaudeModel2;
|
|
27024
27025
|
})(ClaudeModel || {});
|
|
27025
27026
|
var GPTModel = /* @__PURE__ */ ((GPTModel2) => {
|
|
@@ -31473,8 +31474,7 @@ async function callOpenAiWithRetries(identifier, openAiPayload, openAiConfig, re
|
|
|
31473
31474
|
identifier,
|
|
31474
31475
|
"Calling OpenAI API with retries:",
|
|
31475
31476
|
openAiConfig == null ? void 0 : openAiConfig.service,
|
|
31476
|
-
openAiPayload.model
|
|
31477
|
-
openAiConfig == null ? void 0 : openAiConfig.baseUrl
|
|
31477
|
+
openAiPayload.model
|
|
31478
31478
|
);
|
|
31479
31479
|
let errorObj;
|
|
31480
31480
|
for (let i5 = 0; i5 <= retries; i5++) {
|
|
@@ -31559,14 +31559,10 @@ async function callOpenAIStream(identifier, openAiPayload, openAiConfig, chunkTi
|
|
|
31559
31559
|
var _a3, _b, _c, _d, _e, _f, _g;
|
|
31560
31560
|
const functionNames = openAiPayload.tools ? new Set(openAiPayload.tools.map((fn) => fn.function.name)) : null;
|
|
31561
31561
|
if (!openAiConfig) {
|
|
31562
|
-
const defaultOpenAIBaseUrl = (
|
|
31563
|
-
// TODO: Remove this one we have per-provider configs
|
|
31564
|
-
"https://gateway.ai.cloudflare.com/v1/932636fc124abb5171fd630afe668905/igpt"
|
|
31565
|
-
);
|
|
31566
31562
|
openAiConfig = {
|
|
31567
31563
|
service: "openai",
|
|
31568
31564
|
apiKey: process.env.OPENAI_API_KEY,
|
|
31569
|
-
baseUrl:
|
|
31565
|
+
baseUrl: ""
|
|
31570
31566
|
};
|
|
31571
31567
|
}
|
|
31572
31568
|
let response;
|
|
@@ -31584,7 +31580,7 @@ async function callOpenAIStream(identifier, openAiPayload, openAiConfig, chunkTi
|
|
|
31584
31580
|
if (azureConfig.endpoint) {
|
|
31585
31581
|
endpoint = `${azureConfig.endpoint}/openai/deployments/${azureConfig.deployment}/chat/completions?api-version=${azureConfig.apiVersion}`;
|
|
31586
31582
|
} else {
|
|
31587
|
-
endpoint
|
|
31583
|
+
throw new Error("Azure OpenAI endpoint is required in modelConfigMap.");
|
|
31588
31584
|
}
|
|
31589
31585
|
console.log(identifier, "Using endpoint", endpoint);
|
|
31590
31586
|
try {
|
|
@@ -31815,6 +31811,8 @@ async function callAnthropic(identifier, AiPayload, AiConfig) {
|
|
|
31815
31811
|
input_schema: f5.parameters,
|
|
31816
31812
|
parameters: void 0
|
|
31817
31813
|
})),
|
|
31814
|
+
temperature: AiPayload.temperature,
|
|
31815
|
+
system: AiPayload.system,
|
|
31818
31816
|
max_tokens: 4096
|
|
31819
31817
|
},
|
|
31820
31818
|
{
|
|
@@ -31882,18 +31880,7 @@ ${text}`;
|
|
|
31882
31880
|
}
|
|
31883
31881
|
function jigAnthropicMessages(messages) {
|
|
31884
31882
|
var _a3, _b;
|
|
31885
|
-
let jiggedMessages = messages.
|
|
31886
|
-
if (message.role === "system") {
|
|
31887
|
-
return {
|
|
31888
|
-
role: "user",
|
|
31889
|
-
content: `# CONTEXT ---
|
|
31890
|
-
${message.content}
|
|
31891
|
-
Before answering you can reason about the instructions and answer using <thinking></thinking> tags
|
|
31892
|
-
---`
|
|
31893
|
-
};
|
|
31894
|
-
}
|
|
31895
|
-
return message;
|
|
31896
|
-
});
|
|
31883
|
+
let jiggedMessages = messages.slice();
|
|
31897
31884
|
if (((_a3 = jiggedMessages[0]) == null ? void 0 : _a3.role) !== "user") {
|
|
31898
31885
|
jiggedMessages = [
|
|
31899
31886
|
{
|
|
@@ -32066,6 +32053,10 @@ async function prepareAnthropicPayload(payload) {
|
|
|
32066
32053
|
};
|
|
32067
32054
|
for (const message of payload.messages) {
|
|
32068
32055
|
const anthropicContentBlocks = [];
|
|
32056
|
+
if (message.role === "system") {
|
|
32057
|
+
preparedPayload.system = message.content;
|
|
32058
|
+
continue;
|
|
32059
|
+
}
|
|
32069
32060
|
if (message.content) {
|
|
32070
32061
|
anthropicContentBlocks.push({
|
|
32071
32062
|
type: "text",
|