Skip to content

Commit 95142f4

Browse files
committed
wip
1 parent f9a7188 commit 95142f4

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
"simulation",
2424
"typescript"
2525
],
26-
"author": "",
27-
"license": "ISC",
26+
"author": "margostino",
27+
"license": "Apache-2.0",
2828
"dependencies": {
2929
"@asteasolutions/zod-to-openapi": "^7.3.0",
3030
"@types/jsonwebtoken": "^9.0.10",

src/core/llm/createAiProcessor.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export const createAiProcessor = ({
1414
}: {
1515
systemPrompt: string;
1616
model?: string;
17-
schema?: z.ZodTypeAny;
17+
schema?: z.ZodType<any>;
1818
}) => {
1919
const openai: OpenAI = new OpenAI();
2020

@@ -38,9 +38,11 @@ export const createAiProcessor = ({
3838
};
3939

4040
if (schema) {
41+
// @ts-expect-error - zodResponseFormat causes deep type instantiation with complex schemas
42+
const responseFormat = zodResponseFormat(schema, 'output');
4143
completionParams = {
4244
...completionParams,
43-
response_format: zodResponseFormat(schema, 'output'),
45+
response_format: responseFormat,
4446
};
4547
}
4648

tests/globalSetup.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export default () => {
2+
process.env.NODE_ENV = 'test';
3+
process.env.LOG_LEVEL = 'error';
4+
process.env.JWT_SECRET = 'test-secret-key';
5+
process.env.JWT_EXPIRES_IN = '7d';
6+
};

0 commit comments

Comments
 (0)