Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 0.0.184 #3201

Merged
merged 2 commits into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion langchain/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "langchain",
"version": "0.0.183",
"version": "0.0.184",
"description": "Typescript bindings for langchain",
"type": "module",
"engines": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/* eslint-disable no-process-env */
/* eslint-disable @typescript-eslint/no-non-null-assertion */

import { z } from "zod";
import { OpenAI as OpenAIClient } from "openai";
import { AgentExecutor } from "../../../agents/executor.js";
Expand Down Expand Up @@ -64,7 +67,7 @@ class HumanReadableChecker extends StructuredTool {
}
}

test("OpenAIAssistantRunnable can be passed as an agent", async () => {
test.skip("New OpenAIAssistantRunnable can be passed as an agent", async () => {
const tools = [new WeatherTool(), new HumanReadableChecker()];
const agent = await OpenAIAssistantRunnable.createAssistant({
model: "gpt-3.5-turbo-1106",
Expand All @@ -90,7 +93,29 @@ test("OpenAIAssistantRunnable can be passed as an agent", async () => {
*/
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR adds code that accesses an environment variable using process.env. Please review this change to ensure that the environment variable is being used correctly and securely.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR adds code that accesses an environment variable using process.env. Please review this change to ensure that the environment variable is being used correctly and securely.

});

test("OpenAIAssistantRunnable is invokeable", async () => {
test("OpenAIAssistantRunnable can be passed as an agent", async () => {
const tools = [new WeatherTool(), new HumanReadableChecker()];
const agent = new OpenAIAssistantRunnable({
assistantId: process.env.TEST_OPENAI_ASSISTANT_ID!,
asAgent: true,
});
const agentExecutor = AgentExecutor.fromAgentAndTools({
agent,
tools,
});
const assistantResponse = await agentExecutor.invoke({
content:
"What's the weather in San Francisco and Tokyo? And will it be warm or cold in those places?",
});
console.log(assistantResponse);
/**
{
output: "The weather in San Francisco, CA is currently 72掳F and it's warm. In Tokyo, Japan, the temperature is 10掳C and it's also warm."
}
*/
});

test.skip("Created OpenAIAssistantRunnable is invokeable", async () => {
const assistant = await OpenAIAssistantRunnable.createAssistant({
model: "gpt-4",
instructions:
Expand Down