@aibuilders/mcp-coach-server 1.0.1 → 1.0.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.
- package/dist/index.js +5 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -122,6 +122,8 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
catch { }
|
|
125
|
+
// For OpenAI SDK, baseURL should include /v1 since SDK appends paths directly
|
|
126
|
+
const sdkBaseUrl = baseUrl.endsWith('/v1') ? baseUrl : `${baseUrl}/v1`;
|
|
125
127
|
return {
|
|
126
128
|
content: [
|
|
127
129
|
{
|
|
@@ -143,12 +145,12 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
143
145
|
recommendation: "We strongly recommend using the OpenAI SDK to interact with this API. It provides a clean, well-documented interface and handles authentication automatically.",
|
|
144
146
|
usage_note: "You can use OpenAI-compatible SDKs against this API. The OpenAI SDK is the recommended approach.",
|
|
145
147
|
example_node: {
|
|
146
|
-
baseURL:
|
|
148
|
+
baseURL: sdkBaseUrl,
|
|
147
149
|
endpoint: "/v1/chat/completions",
|
|
148
|
-
code_example: `import OpenAI from 'openai';\n\nconst openai = new OpenAI({\n baseURL: '${
|
|
150
|
+
code_example: `import OpenAI from 'openai';\n\nconst openai = new OpenAI({\n baseURL: '${sdkBaseUrl}',\n apiKey: process.env.AI_BUILDER_TOKEN,\n});\n\nconst completion = await openai.chat.completions.create({\n model: 'grok-4-fast',\n messages: [{ role: 'user', content: 'Hello!' }],\n});`
|
|
149
151
|
},
|
|
150
152
|
example_python: {
|
|
151
|
-
code_example: `from openai import OpenAI\nimport os\n\nclient = OpenAI(\n base_url='${
|
|
153
|
+
code_example: `from openai import OpenAI\nimport os\n\nclient = OpenAI(\n base_url='${sdkBaseUrl}',\n api_key=os.getenv('AI_BUILDER_TOKEN')\n)\n\ncompletion = client.chat.completions.create(\n model='grok-4-fast',\n messages=[{'role': 'user', 'content': 'Hello!'}]\n)`
|
|
152
154
|
}
|
|
153
155
|
},
|
|
154
156
|
mcp_recommendation: {
|