Skip to content

Commit

Permalink
Fix test_batch_with_langchain
Browse files Browse the repository at this point in the history
  • Loading branch information
Lina Tang committed Jan 19, 2024
1 parent 9b37266 commit 6c4f04a
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import os


from langchain.chat_models import AzureChatOpenAI
from langchain_core.messages import HumanMessage
from langchain.agents.agent_types import AgentType
from langchain.agents.initialize import initialize_agent
from langchain.agents.load_tools import load_tools


from promptflow import tool
from promptflow.connections import AzureOpenAIConnection
from promptflow.integrations.langchain import PromptFlowCallbackHandler
Expand All @@ -34,5 +32,7 @@ def test_langchain_traces(question: str, conn: AzureOpenAIConnection):
content=question
)

return agent.run(message)

try:
return agent.run(message)
except Exception as e:
return str(e)

0 comments on commit 6c4f04a

Please sign in to comment.