diff --git a/langchain-core/src/language_models/chat_models.ts b/langchain-core/src/language_models/chat_models.ts index 25b0a1467245..197018de6068 100644 --- a/langchain-core/src/language_models/chat_models.ts +++ b/langchain-core/src/language_models/chat_models.ts @@ -730,7 +730,7 @@ export abstract class BaseChatModel< return result.content; } - withStructuredOutput?< + withStructuredOutput< // eslint-disable-next-line @typescript-eslint/no-explicit-any RunOutput extends Record = Record // eslint-disable-next-line @typescript-eslint/no-explicit-any @@ -742,7 +742,7 @@ export abstract class BaseChatModel< config?: StructuredOutputMethodOptions ): Runnable; - withStructuredOutput?< + withStructuredOutput< // eslint-disable-next-line @typescript-eslint/no-explicit-any RunOutput extends Record = Record >( @@ -753,7 +753,7 @@ export abstract class BaseChatModel< config?: StructuredOutputMethodOptions ): Runnable; - withStructuredOutput?< + withStructuredOutput< // eslint-disable-next-line @typescript-eslint/no-explicit-any RunOutput extends Record = Record >( diff --git a/libs/langchain-community/src/chat_models/bedrock/web.ts b/libs/langchain-community/src/chat_models/bedrock/web.ts index 0a2efa10ca9d..56198dad4236 100644 --- a/libs/langchain-community/src/chat_models/bedrock/web.ts +++ b/libs/langchain-community/src/chat_models/bedrock/web.ts @@ -763,60 +763,60 @@ export class BedrockChat return this; } - withStructuredOutput< - // eslint-disable-next-line @typescript-eslint/no-explicit-any - RunOutput extends Record = Record - >( - outputSchema: - | z.ZodType - // eslint-disable-next-line @typescript-eslint/no-explicit-any - | Record, - config?: StructuredOutputMethodOptions - ): Runnable; - - withStructuredOutput< - // eslint-disable-next-line @typescript-eslint/no-explicit-any - RunOutput extends Record = Record - >( - outputSchema: - | z.ZodType - // eslint-disable-next-line @typescript-eslint/no-explicit-any - | Record, - config?: StructuredOutputMethodOptions - ): Runnable; - - withStructuredOutput< - // eslint-disable-next-line @typescript-eslint/no-explicit-any - RunOutput extends Record = Record - >( - outputSchema: - | z.ZodType - // eslint-disable-next-line @typescript-eslint/no-explicit-any - | Record, - config?: StructuredOutputMethodOptions - ): - | Runnable - | Runnable< - BaseLanguageModelInput, - { raw: BaseMessage; parsed: RunOutput } - > { - if (!super.withStructuredOutput) { - throw new Error(`withStructuredOutput is not implemented in the base class. -This is likely due to an outdated version of "@langchain/core". -Please upgrade to the latest version.`); - } - if (config?.includeRaw) { - return super.withStructuredOutput(outputSchema, { - ...config, - includeRaw: true, - }); - } else { - return super.withStructuredOutput(outputSchema, { - ...config, - includeRaw: false, - }); - } - } +// withStructuredOutput< +// // eslint-disable-next-line @typescript-eslint/no-explicit-any +// RunOutput extends Record = Record +// >( +// outputSchema: +// | z.ZodType +// // eslint-disable-next-line @typescript-eslint/no-explicit-any +// | Record, +// config?: StructuredOutputMethodOptions +// ): Runnable; + +// withStructuredOutput< +// // eslint-disable-next-line @typescript-eslint/no-explicit-any +// RunOutput extends Record = Record +// >( +// outputSchema: +// | z.ZodType +// // eslint-disable-next-line @typescript-eslint/no-explicit-any +// | Record, +// config?: StructuredOutputMethodOptions +// ): Runnable; + +// withStructuredOutput< +// // eslint-disable-next-line @typescript-eslint/no-explicit-any +// RunOutput extends Record = Record +// >( +// outputSchema: +// | z.ZodType +// // eslint-disable-next-line @typescript-eslint/no-explicit-any +// | Record, +// config?: StructuredOutputMethodOptions +// ): +// | Runnable +// | Runnable< +// BaseLanguageModelInput, +// { raw: BaseMessage; parsed: RunOutput } +// > { +// if (!super.withStructuredOutput) { +// throw new Error(`withStructuredOutput is not implemented in the base class. +// This is likely due to an outdated version of "@langchain/core". +// Please upgrade to the latest version.`); +// } +// if (config?.includeRaw) { +// return super.withStructuredOutput(outputSchema, { +// ...config, +// includeRaw: true, +// }); +// } else { +// return super.withStructuredOutput(outputSchema, { +// ...config, +// includeRaw: false, +// }); +// } +// } } function isChatGenerationChunk(