Skip to content

Commit

Permalink
Fix: Type defs
Browse files Browse the repository at this point in the history
  • Loading branch information
zya committed Oct 11, 2023
1 parent 153f5f4 commit ab5bfac
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ export async function completion(
params: HandlerParamsStreaming,
): Promise<ResultStreaming>;

export async function completion(params: HandlerParams): Promise<Result>;

export async function completion(params: HandlerParams): Promise<Result> {
const handler = getHandler(params.model);

Expand Down
2 changes: 1 addition & 1 deletion tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ describe('litellm', () => {
mockCreate.mockResolvedValueOnce({
completion: 'response text',
});
const result = (await completion(params)) as ResultNotStreaming;
const result = await completion(params);
const expectedParams = {
model: 'claude-2',
prompt: expectedPrompt,
Expand Down

0 comments on commit ab5bfac

Please sign in to comment.