opensteer 0.4.11 → 0.4.13

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.
@@ -1,5 +1,9 @@
1
1
  // src/ai/model.ts
2
2
  var PROVIDER_MAP = {
3
+ "openai/": { pkg: "@ai-sdk/openai", providerFn: "openai" },
4
+ "anthropic/": { pkg: "@ai-sdk/anthropic", providerFn: "anthropic" },
5
+ "google/": { pkg: "@ai-sdk/google", providerFn: "google" },
6
+ "xai/": { pkg: "@ai-sdk/xai", providerFn: "xai" },
3
7
  "gpt-": { pkg: "@ai-sdk/openai", providerFn: "openai" },
4
8
  "o1-": { pkg: "@ai-sdk/openai", providerFn: "openai" },
5
9
  "o3-": { pkg: "@ai-sdk/openai", providerFn: "openai" },
@@ -17,6 +21,15 @@ function resolveProviderInfo(modelStr) {
17
21
  }
18
22
  return { pkg: "@ai-sdk/openai", providerFn: "openai" };
19
23
  }
24
+ function stripProviderPrefix(modelStr) {
25
+ const slash = modelStr.indexOf("/");
26
+ if (slash <= 0) return modelStr;
27
+ const provider = modelStr.slice(0, slash).toLowerCase();
28
+ if (provider === "openai" || provider === "anthropic" || provider === "google" || provider === "xai" || provider === "groq") {
29
+ return modelStr.slice(slash + 1);
30
+ }
31
+ return modelStr;
32
+ }
20
33
  async function getModelProvider(modelStr) {
21
34
  const { pkg, providerFn } = resolveProviderInfo(modelStr);
22
35
  let mod;
@@ -33,7 +46,7 @@ async function getModelProvider(modelStr) {
33
46
  `Provider '${providerFn}' not found in '${pkg}'. Ensure you have the latest version installed.`
34
47
  );
35
48
  }
36
- const modelId = modelStr.startsWith("groq/") ? modelStr.slice("groq/".length) : modelStr;
49
+ const modelId = stripProviderPrefix(modelStr);
37
50
  return provider(modelId);
38
51
  }
39
52
 
@@ -5,7 +5,7 @@ import {
5
5
  buildExtractSystemPrompt,
6
6
  buildExtractUserPrompt,
7
7
  getModelProvider
8
- } from "./chunk-L4FHT64T.js";
8
+ } from "./chunk-QTGJO7RC.js";
9
9
 
10
10
  // src/ai/extractor.ts
11
11
  function createExtractCallback(model, options) {
@@ -2,7 +2,7 @@ import {
2
2
  buildResolveSystemPrompt,
3
3
  buildResolveUserPrompt,
4
4
  getModelProvider
5
- } from "./chunk-L4FHT64T.js";
5
+ } from "./chunk-QTGJO7RC.js";
6
6
 
7
7
  // src/ai/resolver.ts
8
8
  function createResolveCallback(model, options) {