Skip to content

Commit

Permalink
fix build issues
Browse files Browse the repository at this point in the history
  • Loading branch information
bracesproul committed Apr 8, 2024
1 parent ef0bc0f commit 7fa51f6
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 11 deletions.
5 changes: 1 addition & 4 deletions examples/src/chat/overview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,19 @@ export const run = async () => {
// Sending two separate prompts in parallel, receiving two responses back

const responseA = await chat.invoke([
[

new SystemMessage(
"You are a helpful assistant that translates English to French."
),
new HumanMessage(
"Translate this sentence from English to French. I love programming."
),
],
[
new SystemMessage(
"You are a helpful assistant that translates English to French."
),
new HumanMessage(
"Translate this sentence from English to French. I love artificial intelligence."
),
],
]);

console.log(responseA);
Expand Down
4 changes: 0 additions & 4 deletions examples/src/models/chat/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,18 @@ export const run = async () => {

// Similar to LLMs, you can also use `generate` to generate chat completions for multiple sets of messages.
const responseC = await chat.invoke([
[
new SystemMessage(
"You are a helpful assistant that translates English to French."
),
new HumanMessage(
"Translate this sentence from English to French. I love programming."
),
],
[
new SystemMessage(
"You are a helpful assistant that translates English to French."
),
new HumanMessage(
"Translate this sentence from English to French. I love artificial intelligence."
),
],
]);
console.log(responseC);
/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const model = new ChatOpenAI({
// topLogprobs: 5,
});

const generations = await model.invoke([[new HumanMessage("Hi there!")]]);
const generations = await model.invoke([new HumanMessage("Hi there!")]);

console.log(JSON.stringify(generations, null, 2));

Expand Down
2 changes: 1 addition & 1 deletion examples/src/models/llm/openai-batch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const chat = new ChatOpenAI({
modelName: "gpt-3.5-turbo",
});

const messages = prompts.map((prompt) => [new HumanMessage(prompt)]);
const messages = prompts.map((prompt) => new HumanMessage(prompt));

const res2 = await chat.invoke(messages);
console.log({ res2 });
2 changes: 1 addition & 1 deletion langchain/src/agents/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ export abstract class Agent extends BaseSingleActionAgent {
newInputs.stop = this._stop();
}

const output = await this.llmChain.invoke(newInputs, callbackManager);
const output = await this.llmChain.predict(newInputs, callbackManager);
if (!this.outputParser) {
throw new Error("Output parser not set");
}
Expand Down

0 comments on commit 7fa51f6

Please sign in to comment.