@yourgpt/llm-sdk 2.5.1-beta.0 → 2.5.1-beta.2

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.
@@ -145,6 +145,7 @@ function stripSchemaKeys(schema, keysToDrop, options = {}) {
145
145
  function toOpenAIResponseFormat(rf) {
146
146
  if (!rf) return void 0;
147
147
  if (rf.type === "json_object") return { type: "json_object" };
148
+ if (rf.type !== "json_schema" || !rf.json_schema) return void 0;
148
149
  return {
149
150
  type: "json_schema",
150
151
  json_schema: {
@@ -215,6 +216,7 @@ function toGeminiSchema(rf) {
215
216
  function toOllamaFormat(rf) {
216
217
  if (!rf) return void 0;
217
218
  if (rf.type === "json_object") return "json";
219
+ if (rf.type !== "json_schema" || !rf.json_schema) return void 0;
218
220
  return rf.json_schema.schema;
219
221
  }
220
222
  function formatTools(actions) {
@@ -143,6 +143,7 @@ function stripSchemaKeys(schema, keysToDrop, options = {}) {
143
143
  function toOpenAIResponseFormat(rf) {
144
144
  if (!rf) return void 0;
145
145
  if (rf.type === "json_object") return { type: "json_object" };
146
+ if (rf.type !== "json_schema" || !rf.json_schema) return void 0;
146
147
  return {
147
148
  type: "json_schema",
148
149
  json_schema: {
@@ -213,6 +214,7 @@ function toGeminiSchema(rf) {
213
214
  function toOllamaFormat(rf) {
214
215
  if (!rf) return void 0;
215
216
  if (rf.type === "json_object") return "json";
217
+ if (rf.type !== "json_schema" || !rf.json_schema) return void 0;
216
218
  return rf.json_schema.schema;
217
219
  }
218
220
  function formatTools(actions) {
@@ -112,6 +112,7 @@ function normalizeObjectJsonSchema(schema) {
112
112
  function toOpenAIResponseFormat(rf) {
113
113
  if (!rf) return void 0;
114
114
  if (rf.type === "json_object") return { type: "json_object" };
115
+ if (rf.type !== "json_schema" || !rf.json_schema) return void 0;
115
116
  return {
116
117
  type: "json_schema",
117
118
  json_schema: {
@@ -110,6 +110,7 @@ function normalizeObjectJsonSchema(schema) {
110
110
  function toOpenAIResponseFormat(rf) {
111
111
  if (!rf) return void 0;
112
112
  if (rf.type === "json_object") return { type: "json_object" };
113
+ if (rf.type !== "json_schema" || !rf.json_schema) return void 0;
113
114
  return {
114
115
  type: "json_schema",
115
116
  json_schema: {
@@ -38,6 +38,7 @@ function normalizeObjectJsonSchema(schema) {
38
38
  function toOpenAIResponseFormat(rf) {
39
39
  if (!rf) return void 0;
40
40
  if (rf.type === "json_object") return { type: "json_object" };
41
+ if (rf.type !== "json_schema" || !rf.json_schema) return void 0;
41
42
  return {
42
43
  type: "json_schema",
43
44
  json_schema: {
@@ -36,6 +36,7 @@ function normalizeObjectJsonSchema(schema) {
36
36
  function toOpenAIResponseFormat(rf) {
37
37
  if (!rf) return void 0;
38
38
  if (rf.type === "json_object") return { type: "json_object" };
39
+ if (rf.type !== "json_schema" || !rf.json_schema) return void 0;
39
40
  return {
40
41
  type: "json_schema",
41
42
  json_schema: {
@@ -114,6 +114,7 @@ function buildOpenAITokenParams(modelId, maxTokens, temperature) {
114
114
  function toOpenAIResponseFormat(rf) {
115
115
  if (!rf) return void 0;
116
116
  if (rf.type === "json_object") return { type: "json_object" };
117
+ if (rf.type !== "json_schema" || !rf.json_schema) return void 0;
117
118
  return {
118
119
  type: "json_schema",
119
120
  json_schema: {
@@ -112,6 +112,7 @@ function buildOpenAITokenParams(modelId, maxTokens, temperature) {
112
112
  function toOpenAIResponseFormat(rf) {
113
113
  if (!rf) return void 0;
114
114
  if (rf.type === "json_object") return { type: "json_object" };
115
+ if (rf.type !== "json_schema" || !rf.json_schema) return void 0;
115
116
  return {
116
117
  type: "json_schema",
117
118
  json_schema: {
@@ -81,6 +81,7 @@ function parameterToJsonSchema(param) {
81
81
  function toOllamaFormat(rf) {
82
82
  if (!rf) return void 0;
83
83
  if (rf.type === "json_object") return "json";
84
+ if (rf.type !== "json_schema" || !rf.json_schema) return void 0;
84
85
  return rf.json_schema.schema;
85
86
  }
86
87
  function formatTools(actions) {
@@ -79,6 +79,7 @@ function parameterToJsonSchema(param) {
79
79
  function toOllamaFormat(rf) {
80
80
  if (!rf) return void 0;
81
81
  if (rf.type === "json_object") return "json";
82
+ if (rf.type !== "json_schema" || !rf.json_schema) return void 0;
82
83
  return rf.json_schema.schema;
83
84
  }
84
85
  function formatTools(actions) {
@@ -114,6 +114,7 @@ function buildOpenAITokenParams(modelId, maxTokens, temperature) {
114
114
  function toOpenAIResponseFormat(rf) {
115
115
  if (!rf) return void 0;
116
116
  if (rf.type === "json_object") return { type: "json_object" };
117
+ if (rf.type !== "json_schema" || !rf.json_schema) return void 0;
117
118
  return {
118
119
  type: "json_schema",
119
120
  json_schema: {
@@ -112,6 +112,7 @@ function buildOpenAITokenParams(modelId, maxTokens, temperature) {
112
112
  function toOpenAIResponseFormat(rf) {
113
113
  if (!rf) return void 0;
114
114
  if (rf.type === "json_object") return { type: "json_object" };
115
+ if (rf.type !== "json_schema" || !rf.json_schema) return void 0;
115
116
  return {
116
117
  type: "json_schema",
117
118
  json_schema: {
@@ -114,6 +114,7 @@ function buildOpenAITokenParams(modelId, maxTokens, temperature) {
114
114
  function toOpenAIResponseFormat(rf) {
115
115
  if (!rf) return void 0;
116
116
  if (rf.type === "json_object") return { type: "json_object" };
117
+ if (rf.type !== "json_schema" || !rf.json_schema) return void 0;
117
118
  return {
118
119
  type: "json_schema",
119
120
  json_schema: {
@@ -112,6 +112,7 @@ function buildOpenAITokenParams(modelId, maxTokens, temperature) {
112
112
  function toOpenAIResponseFormat(rf) {
113
113
  if (!rf) return void 0;
114
114
  if (rf.type === "json_object") return { type: "json_object" };
115
+ if (rf.type !== "json_schema" || !rf.json_schema) return void 0;
115
116
  return {
116
117
  type: "json_schema",
117
118
  json_schema: {
@@ -114,6 +114,7 @@ function buildOpenAITokenParams(modelId, maxTokens, temperature) {
114
114
  function toOpenAIResponseFormat(rf) {
115
115
  if (!rf) return void 0;
116
116
  if (rf.type === "json_object") return { type: "json_object" };
117
+ if (rf.type !== "json_schema" || !rf.json_schema) return void 0;
117
118
  return {
118
119
  type: "json_schema",
119
120
  json_schema: {
@@ -112,6 +112,7 @@ function buildOpenAITokenParams(modelId, maxTokens, temperature) {
112
112
  function toOpenAIResponseFormat(rf) {
113
113
  if (!rf) return void 0;
114
114
  if (rf.type === "json_object") return { type: "json_object" };
115
+ if (rf.type !== "json_schema" || !rf.json_schema) return void 0;
115
116
  return {
116
117
  type: "json_schema",
117
118
  json_schema: {
@@ -114,6 +114,7 @@ function buildOpenAITokenParams(modelId, maxTokens, temperature) {
114
114
  function toOpenAIResponseFormat(rf) {
115
115
  if (!rf) return void 0;
116
116
  if (rf.type === "json_object") return { type: "json_object" };
117
+ if (rf.type !== "json_schema" || !rf.json_schema) return void 0;
117
118
  return {
118
119
  type: "json_schema",
119
120
  json_schema: {
@@ -112,6 +112,7 @@ function buildOpenAITokenParams(modelId, maxTokens, temperature) {
112
112
  function toOpenAIResponseFormat(rf) {
113
113
  if (!rf) return void 0;
114
114
  if (rf.type === "json_object") return { type: "json_object" };
115
+ if (rf.type !== "json_schema" || !rf.json_schema) return void 0;
115
116
  return {
116
117
  type: "json_schema",
117
118
  json_schema: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yourgpt/llm-sdk",
3
- "version": "2.5.1-beta.0",
3
+ "version": "2.5.1-beta.2",
4
4
  "description": "AI SDK for building AI Agents with any LLM",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",