Skip to content

Commit

Permalink
fix(runTools): correct request options type (#1073)
Browse files Browse the repository at this point in the history
  • Loading branch information
granmoe authored Sep 16, 2024
1 parent 328f75c commit 399f971
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/resources/beta/chat/completions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export {
ParsingFunction,
ParsingToolFunction,
} from '../../../lib/RunnableFunction';
import { RunnerOptions } from '../../../lib/AbstractChatCompletionRunner';
import { ChatCompletionToolRunnerParams } from '../../../lib/ChatCompletionRunner';
export { ChatCompletionToolRunnerParams } from '../../../lib/ChatCompletionRunner';
import { ChatCompletionStreamingToolRunnerParams } from '../../../lib/ChatCompletionStreamingRunner';
Expand Down Expand Up @@ -119,19 +120,19 @@ export class Completions extends APIResource {
runTools<
Params extends ChatCompletionToolRunnerParams<any>,
ParsedT = ExtractParsedContentFromParams<Params>,
>(body: Params, options?: Core.RequestOptions): ChatCompletionRunner<ParsedT>;
>(body: Params, options?: RunnerOptions): ChatCompletionRunner<ParsedT>;

runTools<
Params extends ChatCompletionStreamingToolRunnerParams<any>,
ParsedT = ExtractParsedContentFromParams<Params>,
>(body: Params, options?: Core.RequestOptions): ChatCompletionStreamingRunner<ParsedT>;
>(body: Params, options?: RunnerOptions): ChatCompletionStreamingRunner<ParsedT>;

runTools<
Params extends ChatCompletionToolRunnerParams<any> | ChatCompletionStreamingToolRunnerParams<any>,
ParsedT = ExtractParsedContentFromParams<Params>,
>(
body: Params,
options?: Core.RequestOptions,
options?: RunnerOptions,
): ChatCompletionRunner<ParsedT> | ChatCompletionStreamingRunner<ParsedT> {
if (body.stream) {
return ChatCompletionStreamingRunner.runTools(
Expand Down

0 comments on commit 399f971

Please sign in to comment.