Closed
Description
Hello.
Maybe it's a silly question but I had a hard time trying pytest with langchain_openai. Can your lib work with langchain_openai with some tweaking? Thanks.
I ran a quick test.
import langchain_openai as openai
import openai_responses
@openai_responses.mock()
def test_create_assistant():
client = openai.Client(api_key="sk-fake123")
assistant = client.beta.assistants.create(
instructions="You are a personal math tutor.",
name="Math Tutor",
tools=[{"type": "code_interpreter"}],
model="gpt-4-turbo",
)
assert assistant.name == "Math Tutor"
I tried this (replacing openai with langchain_openai), but got
AttributeError: module 'langchain_openai' has no attribute 'Client'
when running test_create_assistant()
, probably for an obvious reason.
Metadata
Metadata
Assignees
Labels
Projects
Status
Done