190proof 1.0.3 → 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.mjs CHANGED
@@ -31528,6 +31528,7 @@ async function callOpenAIStream(identifier, openAiPayload, openAiConfig, chunkTi
31528
31528
  baseUrl: defaultOpenAIBaseUrl
31529
31529
  };
31530
31530
  }
31531
+ console.log("payload", openAiPayload);
31531
31532
  let response;
31532
31533
  const controller = new AbortController();
31533
31534
  if (openAiConfig.service === "azure") {
@@ -31903,7 +31904,8 @@ function prepareOpenAIPayload(payload) {
31903
31904
  content: normalizeMessageContent(message.content)
31904
31905
  // TODO: Handle files
31905
31906
  })),
31906
- functions: payload.functions
31907
+ functions: payload.functions,
31908
+ function_call: payload.function_call
31907
31909
  };
31908
31910
  }
31909
31911
  function isGroqPayload(payload) {
@@ -31917,10 +31919,15 @@ function prepareGroqPayload(payload) {
31917
31919
  role: message.role,
31918
31920
  content: normalizeMessageContent(message.content)
31919
31921
  })),
31920
- functions: (_a3 = payload.functions) == null ? void 0 : _a3.map((fn) => ({
31922
+ tools: (_a3 = payload.functions) == null ? void 0 : _a3.map((fn) => ({
31921
31923
  type: "function",
31922
31924
  function: fn
31923
- }))
31925
+ })),
31926
+ tool_choice: payload.function_call ? typeof payload.function_call === "string" ? payload.function_call : {
31927
+ type: "function",
31928
+ function: payload.function_call
31929
+ } : void 0,
31930
+ temperature: payload.temperature
31924
31931
  };
31925
31932
  }
31926
31933
  function normalizeMessageContent(content) {
@@ -31929,11 +31936,7 @@ function normalizeMessageContent(content) {
31929
31936
  async function callGroq(identifier, payload) {
31930
31937
  const response = await axios_default.post(
31931
31938
  "https://api.groq.com/openai/v1/chat/completions",
31932
- {
31933
- model: payload.model,
31934
- messages: payload.messages,
31935
- tools: payload.functions
31936
- },
31939
+ payload,
31937
31940
  {
31938
31941
  headers: {
31939
31942
  "content-type": "application/json",