Skip to content

Commit a84d0a7

Browse files
committed
ai-assistant: LangChainManager: OutputParsers: Fix type issue
Signed-off-by: René Dudfield <renedudfield@microsoft.com>
1 parent 8267e58 commit a84d0a7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ai-assistant/src/langchain/OutputParsers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,10 @@ export function getFormatInstructions(parser: StructuredOutputParser<any>): stri
146146
/**
147147
* Utility function to safely parse responses with error handling
148148
*/
149-
export async function safeParseResponse<T>(
149+
export async function safeParseResponse<T extends z.ZodTypeAny>(
150150
parser: StructuredOutputParser<T>,
151151
response: string
152-
): Promise<{ success: boolean; data?: T; error?: string }> {
152+
): Promise<{ success: boolean; data?: z.infer<T>; error?: string }> {
153153
try {
154154
const parsed = await parser.parse(response);
155155
return { success: true, data: parsed };

0 commit comments

Comments
 (0)