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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code not working #2

Open
bdeva1975 opened this issue Jul 21, 2024 · 0 comments
Open

Code not working #2

bdeva1975 opened this issue Jul 21, 2024 · 0 comments

Comments

@bdeva1975
Copy link

import os
from dotenv import load_dotenv
from langchain import SerpAPIWrapper
from langchain.agents import AgentType, initialize_agent
from langchain.chat_models import AzureChatOpenAI
from langchain.tools import BaseTool, StructuredTool, Tool, tool

Import Azure OpenAI

from langchain.llms import AzureOpenAI
from langchain.schema import HumanMessage

model = AzureChatOpenAI(
deployment_name='gpt-3.5-turbo',
openai_api_type="azure",
)

model(
[
HumanMessage(
content="Translate this sentence from English to French. I love programming."
)
]
)

load_dotenv()

key = os.environ["SERPAPI_API_KEY"]

search = SerpAPIWrapper()
tools = [
Tool.from_function(
func=search.run,
name="Search",
description="useful for when you need to answer questions about current events"
)
]

agent_executor = initialize_agent(tools, model, agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION, verbose=True)

This code is absolutely not working. Please look in it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant