Changesets · Branches · Tags · Compare
| Changeset | 119be314085b7f2bf30866e08ec3e00605e38626cfae2458dd09231e3eb7ab81 |
|---|---|
| Author | uinstinct <61635505+uinstinct@users.noreply.github.com> · 2025-09-17 22:08 +05:30 |
| Committer | uinstinct <61635505+uinstinct@users.noreply.github.com> · 2025-09-17 22:08 +05:30 |
| Parents | 56b312a3daa7 |
1 file changed
modified packages/openai-adapters/src/test/main.test.ts +21 −0
| @@ -309,4 +309,25 @@ | ||
| 309 | 309 | ); |
| 310 | 310 | expect((azure as OpenAIApi).openai.apiKey).toBe("sk-xxx"); |
| 311 | 311 | }); |
| 312 | + | |
| 313 | + it('should have correct default API base for "ollama"', () => { | |
| 314 | + const ollama = constructLlmApi({ | |
| 315 | + provider: "ollama", | |
| 316 | + }); | |
| 317 | + | |
| 318 | + expect((ollama as OpenAIApi).openai.baseURL).toBe( | |
| 319 | + "http://localhost:11434/v1/", | |
| 320 | + ); | |
| 321 | + }); | |
| 322 | + | |
| 323 | + it('should append /v1 to apiBase for "ollama"', () => { | |
| 324 | + const ollama = constructLlmApi({ | |
| 325 | + provider: "ollama", | |
| 326 | + apiBase: "http://localhost:123", | |
| 327 | + }); | |
| 328 | + | |
| 329 | + expect((ollama as OpenAIApi).openai.baseURL).toBe( | |
| 330 | + "http://localhost:123/v1/", | |
| 331 | + ); | |
| 332 | + }); | |
| 312 | 333 | }); |