@tinyclaw/plugin-provider-openai 2.0.0-patch.cfae164 → 2.0.0-pr.d70213b
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 +1 -1
- package/dist/pairing.d.ts +1 -1
- package/dist/provider.js +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
* 3. User provides API key via `openai_pair` → stored securely, tier mapping updated
|
|
12
12
|
* 4. Agent calls `tinyclaw_restart` → supervisor respawns with new configuration
|
|
13
13
|
*/
|
|
14
|
-
import { createOpenAIProvider } from './provider.js';
|
|
15
14
|
import { createOpenAIPairingTools } from './pairing.js';
|
|
15
|
+
import { createOpenAIProvider } from './provider.js';
|
|
16
16
|
const openaiPlugin = {
|
|
17
17
|
id: '@tinyclaw/plugin-provider-openai',
|
|
18
18
|
name: 'OpenAI',
|
package/dist/pairing.d.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* These tools are injected into the agent's tool list at boot so the agent
|
|
10
10
|
* can invoke them conversationally when a user asks to connect OpenAI.
|
|
11
11
|
*/
|
|
12
|
-
import type {
|
|
12
|
+
import type { ConfigManagerInterface, SecretsManagerInterface, Tool } from '@tinyclaw/types';
|
|
13
13
|
/** Secret key for the OpenAI API key. */
|
|
14
14
|
export declare const OPENAI_SECRET_KEY = "provider.openai.apiKey";
|
|
15
15
|
/** Config key for the model setting. */
|
package/dist/provider.js
CHANGED
|
@@ -78,7 +78,7 @@ export function createOpenAIProvider(config) {
|
|
|
78
78
|
const response = await fetch(`${baseUrl}/v1/chat/completions`, {
|
|
79
79
|
method: 'POST',
|
|
80
80
|
headers: {
|
|
81
|
-
|
|
81
|
+
Authorization: `Bearer ${apiKey}`,
|
|
82
82
|
'Content-Type': 'application/json',
|
|
83
83
|
},
|
|
84
84
|
body: JSON.stringify(body),
|
|
@@ -119,7 +119,7 @@ export function createOpenAIProvider(config) {
|
|
|
119
119
|
return false;
|
|
120
120
|
const response = await fetch(`${baseUrl}/v1/models`, {
|
|
121
121
|
headers: {
|
|
122
|
-
|
|
122
|
+
Authorization: `Bearer ${apiKey}`,
|
|
123
123
|
},
|
|
124
124
|
});
|
|
125
125
|
return response.ok;
|