@corbat-tech/coco 1.6.0 → 1.8.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.js CHANGED
@@ -10733,17 +10733,19 @@ var OpenAIProvider = class {
10733
10733
  input = builder.arguments ? JSON.parse(builder.arguments) : {};
10734
10734
  } catch (error) {
10735
10735
  console.warn(
10736
- `[OpenAI] Failed to parse tool call arguments for ${builder.name}: ${builder.arguments?.slice(0, 100)}`
10736
+ `[${this.name}] Failed to parse tool call arguments for ${builder.name}: ${builder.arguments?.slice(0, 100)}`
10737
10737
  );
10738
10738
  try {
10739
10739
  if (builder.arguments) {
10740
10740
  const repaired = jsonrepair(builder.arguments);
10741
10741
  input = JSON.parse(repaired);
10742
- console.log(`[OpenAI] \u2713 Successfully repaired JSON for ${builder.name}`);
10742
+ console.log(`[${this.name}] \u2713 Successfully repaired JSON for ${builder.name}`);
10743
10743
  }
10744
10744
  } catch (repairError) {
10745
- console.error(`[OpenAI] Cannot repair JSON for ${builder.name}, using empty object`);
10746
- console.error(`[OpenAI] Original error:`, error);
10745
+ console.error(
10746
+ `[${this.name}] Cannot repair JSON for ${builder.name}, using empty object`
10747
+ );
10748
+ console.error(`[${this.name}] Original error:`, error);
10747
10749
  }
10748
10750
  }
10749
10751
  yield {
@@ -11038,7 +11040,7 @@ var OpenAIProvider = class {
11038
11040
  return JSON.parse(tc.function.arguments || "{}");
11039
11041
  } catch {
11040
11042
  console.warn(
11041
- `[OpenAI] Failed to parse tool call arguments: ${tc.function.arguments?.slice(0, 100)}`
11043
+ `[${this.name}] Failed to parse tool call arguments: ${tc.function.arguments?.slice(0, 100)}`
11042
11044
  );
11043
11045
  return {};
11044
11046
  }
@@ -11976,12 +11978,12 @@ async function createProvider(type, config = {}) {
11976
11978
  await provider.initialize(mergedConfig);
11977
11979
  return provider;
11978
11980
  case "lmstudio":
11979
- provider = new OpenAIProvider();
11981
+ provider = new OpenAIProvider("lmstudio", "LM Studio");
11980
11982
  mergedConfig.baseUrl = mergedConfig.baseUrl ?? "http://localhost:1234/v1";
11981
11983
  mergedConfig.apiKey = mergedConfig.apiKey ?? "lm-studio";
11982
11984
  break;
11983
11985
  case "ollama":
11984
- provider = new OpenAIProvider();
11986
+ provider = new OpenAIProvider("ollama", "Ollama");
11985
11987
  mergedConfig.baseUrl = mergedConfig.baseUrl ?? "http://localhost:11434/v1";
11986
11988
  mergedConfig.apiKey = mergedConfig.apiKey ?? "ollama";
11987
11989
  break;