Skip to content

Commit

Permalink
🚬 fix lints
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonovono committed Aug 25, 2024
1 parent e3acc7b commit 4cf0832
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/smoke.ts
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ export class ChainSmoker<I = any, O = I> {
configurator?: (config: Configurator<z.infer<S> | string>) => void
): ChainSmoker<I, z.infer<S> | string> {
let schema: S | undefined;
let config = new Configurator<z.infer<S> | string>();
const config = new Configurator<z.infer<S> | string>();

if (schemaOrConfigurator instanceof z.ZodType) {
schema = schemaOrConfigurator;
Expand Down
28 changes: 14 additions & 14 deletions src/utils/executeTools.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { openAIClient } from "../clients/index.ts";
import { createTools } from "./createTools.ts";
import type { ChainSmoker } from "../smoke.ts";
import { z, ZodSchema } from "zod";
import type { z, ZodSchema } from "zod";
import { zodResponseFormat } from "openai/helpers/zod";

/**
Expand Down Expand Up @@ -61,19 +61,19 @@ export async function executeTools<T extends ZodSchema<any>>(

const runnerInstance = openAIClient.beta.chat.completions
.runTools(runnerOptions)
.on("message", (message: any) => {
if (message.role === "tool") {
// console.log(`Tool ${message.name} output: `, message.content);
} else {
// console.log(`Assistant: ${message.content}`);
}
})
.on("functionCall", (message: any) => {
// console.log(`Function call: ${message.name}`, message.arguments);
})
.on("finalFunctionCallResult", (message: any) => {
// console.log(`Final function call result: ${message.name}`, message.arguments);
});
// .on("message", (message: any) => {
// if (message.role === "tool") {
// // console.log(`Tool ${message.name} output: `, message.content);
// } else {
// // console.log(`Assistant: ${message.content}`);
// }
// })
// .on("functionCall", (message: any) => {
// // console.log(`Function call: ${message.name}`, message.arguments);
// })
// .on("finalFunctionCallResult", (message: any) => {
// // console.log(`Final function call result: ${message.name}`, message.arguments);
// });

const finalContent = await runnerInstance.finalContent();
if (finalContent === null) {
Expand Down

0 comments on commit 4cf0832

Please sign in to comment.