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 CHANGED
@@ -1,7 +1,8 @@
1
1
  declare enum ClaudeModel {
2
2
  HAIKU = "claude-3-haiku-20240307",
3
3
  SONNET = "claude-3-sonnet-20240229",
4
- OPUS = "claude-3-opus-20240229"
4
+ OPUS = "claude-3-opus-20240229",
5
+ SONNET_3_5 = "claude-3-5-sonnet-20240620"
5
6
  }
6
7
  declare enum GPTModel {
7
8
  GPT35_0613 = "gpt-3.5-turbo-0613",
package/dist/index.d.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  declare enum ClaudeModel {
2
2
  HAIKU = "claude-3-haiku-20240307",
3
3
  SONNET = "claude-3-sonnet-20240229",
4
- OPUS = "claude-3-opus-20240229"
4
+ OPUS = "claude-3-opus-20240229",
5
+ SONNET_3_5 = "claude-3-5-sonnet-20240620"
5
6
  }
6
7
  declare enum GPTModel {
7
8
  GPT35_0613 = "gpt-3.5-turbo-0613",
package/dist/index.js CHANGED
@@ -27026,6 +27026,7 @@ var ClaudeModel = /* @__PURE__ */ ((ClaudeModel2) => {
27026
27026
  ClaudeModel2["HAIKU"] = "claude-3-haiku-20240307";
27027
27027
  ClaudeModel2["SONNET"] = "claude-3-sonnet-20240229";
27028
27028
  ClaudeModel2["OPUS"] = "claude-3-opus-20240229";
27029
+ ClaudeModel2["SONNET_3_5"] = "claude-3-5-sonnet-20240620";
27029
27030
  return ClaudeModel2;
27030
27031
  })(ClaudeModel || {});
27031
27032
  var GPTModel = /* @__PURE__ */ ((GPTModel2) => {
@@ -31479,8 +31480,7 @@ async function callOpenAiWithRetries(identifier, openAiPayload, openAiConfig, re
31479
31480
  identifier,
31480
31481
  "Calling OpenAI API with retries:",
31481
31482
  openAiConfig == null ? void 0 : openAiConfig.service,
31482
- openAiPayload.model,
31483
- openAiConfig == null ? void 0 : openAiConfig.baseUrl
31483
+ openAiPayload.model
31484
31484
  );
31485
31485
  let errorObj;
31486
31486
  for (let i5 = 0; i5 <= retries; i5++) {
@@ -31565,14 +31565,10 @@ async function callOpenAIStream(identifier, openAiPayload, openAiConfig, chunkTi
31565
31565
  var _a3, _b, _c, _d, _e, _f, _g;
31566
31566
  const functionNames = openAiPayload.tools ? new Set(openAiPayload.tools.map((fn) => fn.function.name)) : null;
31567
31567
  if (!openAiConfig) {
31568
- const defaultOpenAIBaseUrl = (
31569
- // TODO: Remove this one we have per-provider configs
31570
- "https://gateway.ai.cloudflare.com/v1/932636fc124abb5171fd630afe668905/igpt"
31571
- );
31572
31568
  openAiConfig = {
31573
31569
  service: "openai",
31574
31570
  apiKey: process.env.OPENAI_API_KEY,
31575
- baseUrl: defaultOpenAIBaseUrl
31571
+ baseUrl: ""
31576
31572
  };
31577
31573
  }
31578
31574
  let response;
@@ -31590,7 +31586,7 @@ async function callOpenAIStream(identifier, openAiPayload, openAiConfig, chunkTi
31590
31586
  if (azureConfig.endpoint) {
31591
31587
  endpoint = `${azureConfig.endpoint}/openai/deployments/${azureConfig.deployment}/chat/completions?api-version=${azureConfig.apiVersion}`;
31592
31588
  } else {
31593
- endpoint = `${openAiConfig.baseUrl}/azure-openai/${azureConfig.resource}/${azureConfig.deployment}/chat/completions?api-version=${azureConfig.apiVersion}`;
31589
+ throw new Error("Azure OpenAI endpoint is required in modelConfigMap.");
31594
31590
  }
31595
31591
  console.log(identifier, "Using endpoint", endpoint);
31596
31592
  try {
@@ -31821,6 +31817,8 @@ async function callAnthropic(identifier, AiPayload, AiConfig) {
31821
31817
  input_schema: f5.parameters,
31822
31818
  parameters: void 0
31823
31819
  })),
31820
+ temperature: AiPayload.temperature,
31821
+ system: AiPayload.system,
31824
31822
  max_tokens: 4096
31825
31823
  },
31826
31824
  {
@@ -31888,18 +31886,7 @@ ${text}`;
31888
31886
  }
31889
31887
  function jigAnthropicMessages(messages) {
31890
31888
  var _a3, _b;
31891
- let jiggedMessages = messages.map((message) => {
31892
- if (message.role === "system") {
31893
- return {
31894
- role: "user",
31895
- content: `# CONTEXT ---
31896
- ${message.content}
31897
- Before answering you can reason about the instructions and answer using <thinking></thinking> tags
31898
- ---`
31899
- };
31900
- }
31901
- return message;
31902
- });
31889
+ let jiggedMessages = messages.slice();
31903
31890
  if (((_a3 = jiggedMessages[0]) == null ? void 0 : _a3.role) !== "user") {
31904
31891
  jiggedMessages = [
31905
31892
  {
@@ -32072,6 +32059,10 @@ async function prepareAnthropicPayload(payload) {
32072
32059
  };
32073
32060
  for (const message of payload.messages) {
32074
32061
  const anthropicContentBlocks = [];
32062
+ if (message.role === "system") {
32063
+ preparedPayload.system = message.content;
32064
+ continue;
32065
+ }
32075
32066
  if (message.content) {
32076
32067
  anthropicContentBlocks.push({
32077
32068
  type: "text",