File tree Expand file tree Collapse file tree
email-organizer-agent/src/email_organizer Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11from langchain_core .messages import HumanMessage , SystemMessage
22from langgraph .graph import START , StateGraph , END
3- from uipath_langchain_client .clients .openai import UiPathChatOpenAI
43from pydantic import BaseModel
4+ from uipath_langchain .chat import UiPathChat
55
66
77class GraphState (BaseModel ):
Original file line number Diff line number Diff line change 11from langchain .agents import create_agent
22from langchain_community .tools import DuckDuckGoSearchResults
33
4- from uipath_langchain_client . clients . openai import UiPathAzureChatOpenAI
4+ from uipath_langchain . chat import UiPathChatOpenAI
55search_tool = DuckDuckGoSearchResults ()
66
77movie_system_prompt = """You are an advanced AI assistant specializing in movie research and analysis. Your primary functions are:
2727DO NOT do any math calculations unless specifically related to movie statistics or box office figures.
2828"""
2929
30- llm = UiPathAzureChatOpenAI (model = "gpt-4o-mini-2024-07-18" )
30+ llm = UiPathChatOpenAI (model = "gpt-4o-mini-2024-07-18" )
3131graph = create_agent (llm , tools = [search_tool ], system_prompt = movie_system_prompt )
Original file line number Diff line number Diff line change 99from uipath .platform .common import CreateTask
1010from email_organizer .outlook_client import OutlookClient
1111from difflib import SequenceMatcher
12- from uipath_langchain_client .clients .openai import UiPathAzureChatOpenAI
13-
12+ from uipath_langchain .chat import UiPathChat
1413# Configuration
1514DEFAULT_CONFIDENCE = 0.0
1615USER = 'me'
@@ -365,7 +364,7 @@ async def llm_node(state: GraphState) -> Command:
365364 """
366365
367366
368- llm = UiPathAzureChatOpenAI (model = "gpt-4o-mini-2024-07-18" )
367+ llm = UiPathChat (model = "gpt-4o-mini-2024-07-18" )
369368
370369 structured_llm = llm .with_structured_output (RuleSuggestions )
371370 response = await structured_llm .ainvoke (prompt )
Original file line number Diff line number Diff line change 99from uipath .core .guardrails import GuardrailScope
1010
1111from middleware import CustomFilterAction , LoggingMiddleware
12- from uipath_langchain_client .clients .openai import UiPathAzureChatOpenAI
1312from uipath_langchain .guardrails import (
1413 BlockAction ,
1514 PIIDetectionEntity ,
2120 UiPathPromptInjectionMiddleware ,
2221)
2322from uipath_langchain .guardrails .actions import LoggingSeverityLevel
24-
23+ from uipath_langchain . chat import UiPathChat
2524
2625# Define input schema for the agent
2726class Input (BaseModel ):
@@ -34,8 +33,8 @@ class Output(BaseModel):
3433 joke : str
3534
3635
37- # Initialize UiPathAzureChatOpenAI LLM
38- llm = UiPathAzureChatOpenAI (model = "gpt-4o-2024-08-06" , temperature = 0.7 )
36+ # Initialize UiPathChat LLM
37+ llm = UiPathChat (model = "gpt-4o-2024-08-06" , temperature = 0.7 )
3938
4039
4140@tool
You can’t perform that action at this time.
0 commit comments