Skip to content

Commit 91206b1

Browse files
committed
Fix formatting in test file; fix OllamaHandler reference
Signed-off-by: Geoff Wilson <[email protected]>
1 parent 010300c commit 91206b1

File tree

2 files changed

+24
-24
lines changed

2 files changed

+24
-24
lines changed

src/api/__tests__/index.spec.ts

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ describe("API Environment Variable Integration", () => {
8585
describe("anthropic provider", () => {
8686
it("should use environment variable when anthropicConfigUseEnvVars is true", () => {
8787
process.env.ANTHROPIC_API_KEY = "env-anthropic-key"
88-
88+
8989
const config: ProviderSettings = {
9090
apiProvider: "anthropic",
9191
apiKey: "config-key",
@@ -98,7 +98,7 @@ describe("API Environment Variable Integration", () => {
9898

9999
it("should use config value when anthropicConfigUseEnvVars is false", () => {
100100
process.env.ANTHROPIC_API_KEY = "env-anthropic-key"
101-
101+
102102
const config: ProviderSettings = {
103103
apiProvider: "anthropic",
104104
apiKey: "config-key",
@@ -111,7 +111,7 @@ describe("API Environment Variable Integration", () => {
111111

112112
it("should fallback to config value when env var not set", () => {
113113
delete process.env.ANTHROPIC_API_KEY
114-
114+
115115
const config: ProviderSettings = {
116116
apiProvider: "anthropic",
117117
apiKey: "config-key",
@@ -126,7 +126,7 @@ describe("API Environment Variable Integration", () => {
126126
describe("glama provider", () => {
127127
it("should use environment variable when glamaConfigUseEnvVars is true", () => {
128128
process.env.GLAMA_API_KEY = "env-glama-key"
129-
129+
130130
const config: ProviderSettings = {
131131
apiProvider: "glama",
132132
glamaApiKey: "config-key",
@@ -139,7 +139,7 @@ describe("API Environment Variable Integration", () => {
139139

140140
it("should use config value when glamaConfigUseEnvVars is false", () => {
141141
process.env.GLAMA_API_KEY = "env-glama-key"
142-
142+
143143
const config: ProviderSettings = {
144144
apiProvider: "glama",
145145
glamaApiKey: "config-key",
@@ -154,7 +154,7 @@ describe("API Environment Variable Integration", () => {
154154
describe("openrouter provider", () => {
155155
it("should use environment variable when openRouterConfigUseEnvVars is true", () => {
156156
process.env.OPEN_ROUTER_API_KEY = "env-openrouter-key"
157-
157+
158158
const config: ProviderSettings = {
159159
apiProvider: "openrouter",
160160
openRouterApiKey: "config-key",
@@ -169,7 +169,7 @@ describe("API Environment Variable Integration", () => {
169169
describe("openai provider", () => {
170170
it("should use environment variable when openAiConfigUseEnvVars is true", () => {
171171
process.env.OPENAI_API_KEY = "env-openai-key"
172-
172+
173173
const config: ProviderSettings = {
174174
apiProvider: "openai",
175175
openAiApiKey: "config-key",
@@ -184,7 +184,7 @@ describe("API Environment Variable Integration", () => {
184184
describe("gemini provider", () => {
185185
it("should use environment variable when geminiConfigUseEnvVars is true", () => {
186186
process.env.GEMINI_API_KEY = "env-gemini-key"
187-
187+
188188
const config: ProviderSettings = {
189189
apiProvider: "gemini",
190190
geminiApiKey: "config-key",
@@ -199,7 +199,7 @@ describe("API Environment Variable Integration", () => {
199199
describe("openai-native provider", () => {
200200
it("should use environment variable when openAiNativeConfigUseEnvVars is true", () => {
201201
process.env.OPENAI_API_KEY = "env-openai-native-key"
202-
202+
203203
const config: ProviderSettings = {
204204
apiProvider: "openai-native",
205205
openAiNativeApiKey: "config-key",
@@ -214,7 +214,7 @@ describe("API Environment Variable Integration", () => {
214214
describe("mistral provider", () => {
215215
it("should use environment variable when mistralConfigUseEnvVars is true", () => {
216216
process.env.MISTRAL_API_KEY = "env-mistral-key"
217-
217+
218218
const config: ProviderSettings = {
219219
apiProvider: "mistral",
220220
mistralApiKey: "config-key",
@@ -229,7 +229,7 @@ describe("API Environment Variable Integration", () => {
229229
describe("deepseek provider", () => {
230230
it("should use environment variable when deepSeekConfigUseEnvVars is true", () => {
231231
process.env.DEEP_SEEK_API_KEY = "env-deepseek-key"
232-
232+
233233
const config: ProviderSettings = {
234234
apiProvider: "deepseek",
235235
deepSeekApiKey: "config-key",
@@ -244,7 +244,7 @@ describe("API Environment Variable Integration", () => {
244244
describe("unbound provider", () => {
245245
it("should use environment variable when unboundConfigUseEnvVars is true", () => {
246246
process.env.UNBOUND_API_KEY = "env-unbound-key"
247-
247+
248248
const config: ProviderSettings = {
249249
apiProvider: "unbound",
250250
unboundApiKey: "config-key",
@@ -259,7 +259,7 @@ describe("API Environment Variable Integration", () => {
259259
describe("requesty provider", () => {
260260
it("should use environment variable when requestyConfigUseEnvVars is true", () => {
261261
process.env.REQUESTY_API_KEY = "env-requesty-key"
262-
262+
263263
const config: ProviderSettings = {
264264
apiProvider: "requesty",
265265
requestyApiKey: "config-key",
@@ -274,7 +274,7 @@ describe("API Environment Variable Integration", () => {
274274
describe("xai provider", () => {
275275
it("should use environment variable when xaiConfigUseEnvVars is true", () => {
276276
process.env.XAI_API_KEY = "env-xai-key"
277-
277+
278278
const config: ProviderSettings = {
279279
apiProvider: "xai",
280280
xaiApiKey: "config-key",
@@ -289,7 +289,7 @@ describe("API Environment Variable Integration", () => {
289289
describe("groq provider", () => {
290290
it("should use environment variable when groqConfigUseEnvVars is true", () => {
291291
process.env.GROQ_API_KEY = "env-groq-key"
292-
292+
293293
const config: ProviderSettings = {
294294
apiProvider: "groq",
295295
groqApiKey: "config-key",
@@ -304,7 +304,7 @@ describe("API Environment Variable Integration", () => {
304304
describe("chutes provider", () => {
305305
it("should use environment variable when chutesConfigUseEnvVars is true", () => {
306306
process.env.CHUTES_API_KEY = "env-chutes-key"
307-
307+
308308
const config: ProviderSettings = {
309309
apiProvider: "chutes",
310310
chutesApiKey: "config-key",
@@ -319,7 +319,7 @@ describe("API Environment Variable Integration", () => {
319319
describe("litellm provider", () => {
320320
it("should use environment variable when litellmConfigUseEnvVars is true", () => {
321321
process.env.LITELLM_API_KEY = "env-litellm-key"
322-
322+
323323
const config: ProviderSettings = {
324324
apiProvider: "litellm",
325325
litellmApiKey: "config-key",
@@ -364,7 +364,7 @@ describe("API Environment Variable Integration", () => {
364364
describe("edge cases", () => {
365365
it("should handle missing apiKeyUseEnvVar flag gracefully", () => {
366366
process.env.ANTHROPIC_API_KEY = "env-anthropic-key"
367-
367+
368368
const config: ProviderSettings = {
369369
apiProvider: "anthropic",
370370
apiKey: "config-key",
@@ -390,7 +390,7 @@ describe("API Environment Variable Integration", () => {
390390
"XAI_API_KEY",
391391
"GROQ_API_KEY",
392392
"CHUTES_API_KEY",
393-
"LITELLM_API_KEY"
393+
"LITELLM_API_KEY",
394394
]
395395

396396
envVars.forEach((envVar, index) => {
@@ -406,7 +406,7 @@ describe("API Environment Variable Integration", () => {
406406

407407
it("should not mutate original config object", () => {
408408
process.env.ANTHROPIC_API_KEY = "env-anthropic-key"
409-
409+
410410
const originalConfig: ProviderSettings = {
411411
apiProvider: "anthropic",
412412
apiKey: "config-key",
@@ -423,7 +423,7 @@ describe("API Environment Variable Integration", () => {
423423

424424
it("should handle undefined config values gracefully", () => {
425425
process.env.ANTHROPIC_API_KEY = "env-anthropic-key"
426-
426+
427427
const config: ProviderSettings = {
428428
apiProvider: "anthropic",
429429
apiKey: undefined as any,
@@ -435,4 +435,4 @@ describe("API Environment Variable Integration", () => {
435435
})
436436
})
437437
})
438-
})
438+
})

src/api/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ import {
3737
FireworksHandler,
3838
RooHandler,
3939
FeatherlessHandler,
40+
OllamaHandler,
4041
} from "./providers"
41-
import { NativeOllamaHandler } from "./providers/native-ollama"
4242

4343
export interface SingleCompletionHandler {
4444
completePrompt(prompt: string): Promise<string>
@@ -123,7 +123,7 @@ export function buildApiHandler(configuration: ProviderSettings): ApiHandler {
123123
}
124124
return new OpenAiHandler(options)
125125
case "ollama":
126-
return new NativeOllamaHandler(options)
126+
return new OllamaHandler(options)
127127
case "lmstudio":
128128
return new LmStudioHandler(options)
129129
case "gemini":

0 commit comments

Comments
 (0)