+7
-1
@@ -93,3 +93,9 @@ /** @deprecated Use provider prefix strings instead, e.g. `"anthropic:claude-sonnet-4-5"` */ | ||
| apiKey: string; | ||
| baseUrl: string; | ||
| /** | ||
| * Override the base URL for the OpenAI service (e.g. an OpenAI-compatible | ||
| * proxy or self-hosted endpoint). The path `/chat/completions` is appended. | ||
| * Ignored when `service === "azure"` (use `modelConfigMap` instead). | ||
| * Defaults to `https://api.openai.com/v1`. | ||
| */ | ||
| baseUrl?: string; | ||
| orgId?: string; | ||
@@ -96,0 +102,0 @@ modelConfigMap?: Record<GPTModel, { |
+7
-1
@@ -93,3 +93,9 @@ /** @deprecated Use provider prefix strings instead, e.g. `"anthropic:claude-sonnet-4-5"` */ | ||
| apiKey: string; | ||
| baseUrl: string; | ||
| /** | ||
| * Override the base URL for the OpenAI service (e.g. an OpenAI-compatible | ||
| * proxy or self-hosted endpoint). The path `/chat/completions` is appended. | ||
| * Ignored when `service === "azure"` (use `modelConfigMap` instead). | ||
| * Defaults to `https://api.openai.com/v1`. | ||
| */ | ||
| baseUrl?: string; | ||
| orgId?: string; | ||
@@ -96,0 +102,0 @@ modelConfigMap?: Record<GPTModel, { |
+6
-1
@@ -267,2 +267,3 @@ "use strict"; | ||
| function buildOpenAIRequestConfig(identifier, model, config) { | ||
| var _a; | ||
| if (!config) { | ||
@@ -300,4 +301,8 @@ config = { | ||
| } | ||
| const base = (((_a = config.baseUrl) == null ? void 0 : _a.trim()) || "https://api.openai.com/v1").replace( | ||
| /\/$/, | ||
| "" | ||
| ); | ||
| return { | ||
| endpoint: "https://api.openai.com/v1/chat/completions", | ||
| endpoint: `${base}/chat/completions`, | ||
| headers: { | ||
@@ -304,0 +309,0 @@ "Content-Type": "application/json", |
+6
-1
@@ -236,2 +236,3 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { | ||
| function buildOpenAIRequestConfig(identifier, model, config) { | ||
| var _a; | ||
| if (!config) { | ||
@@ -269,4 +270,8 @@ config = { | ||
| } | ||
| const base = (((_a = config.baseUrl) == null ? void 0 : _a.trim()) || "https://api.openai.com/v1").replace( | ||
| /\/$/, | ||
| "" | ||
| ); | ||
| return { | ||
| endpoint: "https://api.openai.com/v1/chat/completions", | ||
| endpoint: `${base}/chat/completions`, | ||
| headers: { | ||
@@ -273,0 +278,0 @@ "Content-Type": "application/json", |
+2
-2
| { | ||
| "name": "190proof", | ||
| "version": "1.0.89", | ||
| "version": "1.0.90", | ||
| "description": "", | ||
@@ -15,3 +15,3 @@ "main": "./dist/index.js", | ||
| "build": "tsup", | ||
| "send": "npm run build && git add . && git commit -am checkpoint && npm version patch && npm login && npm publish" | ||
| "send": "npm run build && git add . && (git diff --cached --quiet || git commit -am checkpoint) && npm version patch && npm login && npm publish" | ||
| }, | ||
@@ -18,0 +18,0 @@ "author": "", |
+23
-1
@@ -315,3 +315,8 @@ # 190proof | ||
| apiKey: string; | ||
| baseUrl: string; | ||
| /** | ||
| * Optional base URL. Defaults to `https://api.openai.com/v1`. Set to point | ||
| * at any OpenAI-compatible endpoint (e.g. a self-hosted proxy). The path | ||
| * `/chat/completions` is appended automatically. Ignored for Azure. | ||
| */ | ||
| baseUrl?: string; | ||
| orgId?: string; | ||
@@ -331,2 +336,19 @@ modelConfigMap?: Record< | ||
| To talk to an OpenAI-compatible server instead of OpenAI itself: | ||
| ```typescript | ||
| await callWithRetries( | ||
| "my-identifier", | ||
| { | ||
| model: "openai:gpt-4o-mini", | ||
| messages: [{ role: "user", content: "hi" }], | ||
| }, | ||
| { | ||
| service: "openai", | ||
| apiKey: process.env.SOME_SERVER_API_KEY, | ||
| baseUrl: "https://your-proxy.example.com/v1", | ||
| }, | ||
| ); | ||
| ``` | ||
| #### Anthropic Config | ||
@@ -333,0 +355,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
261451
0.98%2515
0.64%363
6.45%