Skip to content
This repository has been archived by the owner on Apr 1, 2024. It is now read-only.

Commit

Permalink
0.4.204
Browse files Browse the repository at this point in the history
  • Loading branch information
fardjad committed Feb 7, 2024
1 parent f614f7c commit 3197c45
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "llmatic",
"version": "0.4.203",
"version": "0.4.204",
"description": "Use self-hosted LLMs with an OpenAI compatible API",
"exports": {
"./llm-adapter": {
Expand Down
6 changes: 3 additions & 3 deletions src/handlers/create-chat-completion.handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ export default class CreateChatCompletionHandler implements OperationHandler {
}

choices[index] ??= {
index,
message: { role: Role.Assistant, content: "" },
};
index,
message: { role: Role.Assistant, content: "" },
};

choices[index].finish_reason = finishReason;

Expand Down
6 changes: 3 additions & 3 deletions src/handlers/create-completion.handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ export default class CreateCompletionHandler implements OperationHandler {
}

choices[index] ??= {
index,
};
index,
};

choices[index].finish_reason = finishReason;
choiceTokens[index] ??= [];
Expand All @@ -134,7 +134,7 @@ export default class CreateCompletionHandler implements OperationHandler {
}

choice.text = choiceTokens[index].join("");
choice.finish_reason = choice.finish_reason ?? "stop";
choice.finish_reason ??= "stop";
}

const response: CreateCompletionOkResponse = {
Expand Down

0 comments on commit 3197c45

Please sign in to comment.