diff --git a/src/model.ts b/src/model.ts index dc0dafcb..ada053cb 100644 --- a/src/model.ts +++ b/src/model.ts @@ -86,7 +86,7 @@ export function createAzureOpenAILanguageModel(apiKey: string, endPoint: string, /** * Common implementation of language model encapsulation of an OpenAI REST API endpoint. */ -function createAxiosLanguageModel(url: string, config: object, defaultParams: Record) { +export function createAxiosLanguageModel(url: string, config: object, defaultParams: Record) { const client = axios.create(config); const model: TypeChatLanguageModel = { complete @@ -99,9 +99,9 @@ function createAxiosLanguageModel(url: string, config: object, defaultParams: Re const retryPauseMs = model.retryPauseMs ?? 1000; while (true) { const params = { + temperature: 0, ...defaultParams, messages: [{ role: "user", content: prompt }], - temperature: 0, n: 1 }; const result = await client.post(url, params, { validateStatus: status => true });