Elffuss BraidHub

kikocis/continue public

add tests
Changeset119be314085b7f2bf30866e08ec3e00605e38626cfae2458dd09231e3eb7ab81
Authoruinstinct <61635505+uinstinct@users.noreply.github.com> · 2025-09-17 22:08 +05:30
Committeruinstinct <61635505+uinstinct@users.noreply.github.com> · 2025-09-17 22:08 +05:30
Parents56b312a3daa7

Browse the files at this changeset

1 file changed

modified packages/openai-adapters/src/test/main.test.ts +21 −0
@@ -309,4 +309,25 @@
309309 );
310310 expect((azure as OpenAIApi).openai.apiKey).toBe("sk-xxx");
311311 });
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+ });
312333 });