Skip to content

Commit 00628f8

Browse files
committed
refactor: improve type safety for Ollama client configuration
- Replace 'any' type with proper OllamaOptions (Config) type - Import Config type from ollama package for better type checking
1 parent 0db0df5 commit 00628f8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/api/providers/native-ollama.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Anthropic } from "@anthropic-ai/sdk"
2-
import { Message, Ollama } from "ollama"
2+
import { Message, Ollama, type Config as OllamaOptions } from "ollama"
33
import { ModelInfo, openAiModelInfoSaneDefaults, DEEP_SEEK_DEFAULT_TEMPERATURE } from "@roo-code/types"
44
import { ApiStream } from "../transform/stream"
55
import { BaseProvider } from "./base-provider"
@@ -140,7 +140,7 @@ export class NativeOllamaHandler extends BaseProvider implements SingleCompletio
140140
private ensureClient(): Ollama {
141141
if (!this.client) {
142142
try {
143-
const clientOptions: any = {
143+
const clientOptions: OllamaOptions = {
144144
host: this.options.ollamaBaseUrl || "http://localhost:11434",
145145
// Note: The ollama npm package handles timeouts internally
146146
}

0 commit comments

Comments
 (0)