@wrongstack/providers 0.250.0 → 0.256.0

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.ts CHANGED
@@ -130,7 +130,7 @@ interface OpenAIToolSchema {
130
130
  declare function toolsToOpenAI(tools: Tool[]): OpenAIToolSchema[];
131
131
  interface OpenAIMessage {
132
132
  role: 'system' | 'user' | 'assistant' | 'tool';
133
- content?: string | OpenAIContent[] | undefined;
133
+ content?: string | OpenAIContent[] | null | undefined;
134
134
  tool_calls?: OpenAIToolCall[] | undefined;
135
135
  tool_call_id?: string | undefined;
136
136
  name?: string | undefined;
package/dist/index.js CHANGED
@@ -1248,8 +1248,9 @@ function messagesToOpenAI(system, messages, opts = {}) {
1248
1248
  message.tool_calls = toolCalls;
1249
1249
  if (text) {
1250
1250
  message.content = text;
1251
- } else if (opts.emptyToolCallContent === "empty_string") {
1252
- message.content = "";
1251
+ } else {
1252
+ const emptyContentMode = opts.emptyToolCallContent ?? "empty_string";
1253
+ message.content = emptyContentMode === "null" ? null : "";
1253
1254
  }
1254
1255
  } else {
1255
1256
  message.content = text;