Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, string>) {
export function createAxiosLanguageModel(url: string, config: object, defaultParams: Record<string, string>) {
const client = axios.create(config);
const model: TypeChatLanguageModel = {
complete
Expand All @@ -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 });
Expand Down