Skip to content

Commit

Permalink
Fixes related to 1.3 SDK upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
FilipZmijewski authored Dec 10, 2024
1 parent e8dd081 commit cd38500
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion libs/langchain-community/src/document_compressors/ibm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export class WatsonxRerank
? {
index: document.index,
relevanceScore: document.score,
input: document?.input,
input: document?.input.text,
}
: {
index: document.index,
Expand Down
8 changes: 5 additions & 3 deletions libs/langchain-community/src/llms/ibm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ export class WatsonxLLM<
const watsonxCallbacks = this.invocationCallbacks(options);
if (stream) {
const textStream = idOrName
? await this.service.deploymentGenerateTextStream({
? this.service.deploymentGenerateTextStream({
idOrName,
...requestOptions,
parameters: {
Expand All @@ -309,7 +309,7 @@ export class WatsonxLLM<
},
returnObject: true,
})
: await this.service.generateTextStream(
: this.service.generateTextStream(
{
input,
parameters,
Expand All @@ -319,7 +319,9 @@ export class WatsonxLLM<
},
watsonxCallbacks
);
return textStream;
return (await textStream) as AsyncIterable<
WatsonXAI.ObjectStreamed<WatsonXAI.TextGenResponse>
>;
} else {
const textGenerationPromise = idOrName
? this.service.deploymentGenerateText(
Expand Down

0 comments on commit cd38500

Please sign in to comment.