uipath-langchain 0.0.130__py3-none-any.whl → 0.0.131__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of uipath-langchain might be problematic. Click here for more details.

@@ -1,28 +1,27 @@
1
- from langchain_anthropic import ChatAnthropic
2
1
  from langchain_core.messages import HumanMessage, SystemMessage
3
- from langchain_openai import ChatOpenAI
4
2
  from langgraph.graph import START, StateGraph, END
3
+ from uipath_langchain.chat import UiPathChat
5
4
  from pydantic import BaseModel
6
- import os
5
+
6
+ llm = UiPathChat(model="gpt-4o-mini-2024-07-18")
7
+
7
8
 
8
9
  class GraphState(BaseModel):
9
10
  topic: str
10
11
 
12
+
11
13
  class GraphOutput(BaseModel):
12
14
  report: str
13
15
 
14
- async def generate_report(state: GraphState) -> GraphOutput:
15
- if os.getenv("ANTHROPIC_API_KEY"):
16
- llm_model = ChatAnthropic(model="claude-3-5-sonnet-latest")
17
- elif os.getenv("OPENAI_API_KEY"):
18
- llm_model = ChatOpenAI(model="gpt-4o-mini", temperature=0)
19
- else:
20
- raise Exception("Missing API Key. Please define either ANTHROPIC_API_KEY or OPENAI_API_KEY.")
21
16
 
17
+ async def generate_report(state: GraphState) -> GraphOutput:
22
18
  system_prompt = "You are a report generator. Please provide a brief report based on the given topic."
23
- output = await llm_model.ainvoke([SystemMessage(system_prompt), HumanMessage(state.topic)])
19
+ output = await llm.ainvoke(
20
+ [SystemMessage(system_prompt), HumanMessage(state.topic)]
21
+ )
24
22
  return GraphOutput(report=output.content)
25
23
 
24
+
26
25
  builder = StateGraph(GraphState, output=GraphOutput)
27
26
 
28
27
  builder.add_node("generate_report", generate_report)
@@ -8,7 +8,6 @@ from dataclasses import dataclass
8
8
  from pathlib import Path
9
9
  from typing import Any, Dict, List, Optional, Union, cast
10
10
 
11
- from dotenv import load_dotenv
12
11
  from langgraph.graph import StateGraph
13
12
  from langgraph.graph.state import CompiledStateGraph
14
13
 
@@ -161,18 +160,6 @@ class LangGraphConfig:
161
160
  f"Missing required fields in langgraph.json: {missing_fields}"
162
161
  )
163
162
 
164
- if env_file := config.get("env"):
165
- env_path = os.path.abspath(os.path.normpath(env_file))
166
- if os.path.exists(env_path):
167
- if not load_dotenv(env_path):
168
- # log warning only if dotenv is not empty
169
- if os.path.getsize(env_path) > 0:
170
- logger.warning(
171
- f"Could not load environment variables from {env_path}"
172
- )
173
- else:
174
- logger.debug(f"Loaded environment variables from {env_path}")
175
-
176
163
  self._config = config
177
164
  self._load_graphs()
178
165
  return config
@@ -54,9 +54,6 @@ def langgraph_new_middleware(name: str) -> MiddlewareResult:
54
54
  console.success("Created 'langgraph.json' file.")
55
55
  generate_pyproject(directory, name)
56
56
  console.success("Created 'pyproject.toml' file.")
57
- console.config(
58
- f""" Please ensure to define either {click.style("ANTHROPIC_API_KEY", fg="bright_yellow")} or {click.style("OPENAI_API_KEY", fg="bright_yellow")} in your .env file. """
59
- )
60
57
  init_command = """uipath init"""
61
58
  run_command = """uipath run agent '{"topic": "UiPath"}'"""
62
59
  console.hint(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: uipath-langchain
3
- Version: 0.0.130
3
+ Version: 0.0.131
4
4
  Summary: UiPath Langchain
5
5
  Project-URL: Homepage, https://uipath.com
6
6
  Project-URL: Repository, https://github.com/UiPath/uipath-langchain-python
@@ -25,7 +25,7 @@ Requires-Dist: openai>=1.65.5
25
25
  Requires-Dist: openinference-instrumentation-langchain>=0.1.50
26
26
  Requires-Dist: pydantic-settings>=2.6.0
27
27
  Requires-Dist: python-dotenv>=1.0.1
28
- Requires-Dist: uipath<2.2.0,>=2.1.49
28
+ Requires-Dist: uipath<2.2.0,>=2.1.54
29
29
  Provides-Extra: langchain
30
30
  Description-Content-Type: text/markdown
31
31
 
@@ -4,7 +4,7 @@ uipath_langchain/_cli/__init__.py,sha256=juqd9PbXs4yg45zMJ7BHAOPQjb7sgEbWE9InBtG
4
4
  uipath_langchain/_cli/cli_dev.py,sha256=VlI8qgCw-63I97tp_9lbXs-CVcNSjpd2sC13YNZAIuU,1401
5
5
  uipath_langchain/_cli/cli_eval.py,sha256=eGhvenAKJDdt9zIYWO7k01zJ7T1tGte7a6zz06iO6cw,2539
6
6
  uipath_langchain/_cli/cli_init.py,sha256=xhxJ8tuMSrVUNHvltgyPpOrvgMA-wq9shHeYYwvHILs,8199
7
- uipath_langchain/_cli/cli_new.py,sha256=dL8-Rri6u67ZZdbb4nT38A5xD_Q3fVnG0UK9VSeKaqg,2563
7
+ uipath_langchain/_cli/cli_new.py,sha256=KKLxCzz7cDQ__rRr_a496IHWlSQXhmrBNgmKHnXAnTY,2336
8
8
  uipath_langchain/_cli/cli_run.py,sha256=FT4ilVCBNSYllB-wS6__0E0fWKlrQEhO9N74wNHPffs,2056
9
9
  uipath_langchain/_cli/_runtime/_context.py,sha256=yyzYJDmk2fkH4T5gm4cLGRyXtjLESrpzHBT9euqluTA,817
10
10
  uipath_langchain/_cli/_runtime/_conversation.py,sha256=S1KTx_q-La7ikPRT3nBcIp8t-J9CF0QB0DCduQIIB28,11149
@@ -13,8 +13,8 @@ uipath_langchain/_cli/_runtime/_input.py,sha256=3IKrZR9xmxYg6l_1TbFpaLOWPDvK8d3n
13
13
  uipath_langchain/_cli/_runtime/_output.py,sha256=yJOZPWv2FRUJWv1NRs9JmpB4QMTDXu8jrxoaKrfJvzw,9078
14
14
  uipath_langchain/_cli/_runtime/_runtime.py,sha256=ai-r6cYp4YbJqGhxWGvL68BHtJGhYhAZF-MEhKT7ceY,14955
15
15
  uipath_langchain/_cli/_templates/langgraph.json.template,sha256=eeh391Gta_hoRgaNaZ58nW1LNvCVXA7hlAH6l7Veous,107
16
- uipath_langchain/_cli/_templates/main.py.template,sha256=nMJQIYPlRk90iANfNVpkJ2EQX20Dxsyq92-BucEz_UM,1189
17
- uipath_langchain/_cli/_utils/_graph.py,sha256=JPShHNl0UQvl4AdjLIqLpNt_JAjpWH9WWF22Gs47Xew,7445
16
+ uipath_langchain/_cli/_templates/main.py.template,sha256=GpSblGH2hwS9ibqQmX2iB2nsmOA5zDfEEF4ChLiMxbQ,875
17
+ uipath_langchain/_cli/_utils/_graph.py,sha256=nMJWy8FmaD9rqPUY2lHc5uVpUzbXD1RO12uJnhe0kdo,6803
18
18
  uipath_langchain/_utils/__init__.py,sha256=WoY66enCygRXTh6v5B1UrRcFCnQYuPJ8oqDkwomXzLc,194
19
19
  uipath_langchain/_utils/_request_mixin.py,sha256=ddKFs_0mjoFCmvPTiOTPJh1IIqYUo5CUka-B7zAZphE,19695
20
20
  uipath_langchain/_utils/_settings.py,sha256=2fExMQJ88YptfldmzMfZIpsx-m1gfMkeYGf5t6KIe0A,3084
@@ -33,8 +33,8 @@ uipath_langchain/tracers/_instrument_traceable.py,sha256=0e841zVzcPWjOGtmBx0GeHb
33
33
  uipath_langchain/tracers/_utils.py,sha256=JOT1tKMdvqjMDtj2WbmbOWMeMlTXBWavxWpogX7KlRA,1543
34
34
  uipath_langchain/vectorstores/__init__.py,sha256=w8qs1P548ud1aIcVA_QhBgf_jZDrRMK5Lono78yA8cs,114
35
35
  uipath_langchain/vectorstores/context_grounding_vectorstore.py,sha256=TncIXG-YsUlO0R5ZYzWsM-Dj1SVCZbzmo2LraVxXelc,9559
36
- uipath_langchain-0.0.130.dist-info/METADATA,sha256=scZv_AxHBJjIMWBIWNcTU---140Ml8Tgy8TzNGSOkTU,4235
37
- uipath_langchain-0.0.130.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
38
- uipath_langchain-0.0.130.dist-info/entry_points.txt,sha256=FUtzqGOEntlJKMJIXhQUfT7ZTbQmGhke1iCmDWZaQZI,81
39
- uipath_langchain-0.0.130.dist-info/licenses/LICENSE,sha256=JDpt-uotAkHFmxpwxi6gwx6HQ25e-lG4U_Gzcvgp7JY,1063
40
- uipath_langchain-0.0.130.dist-info/RECORD,,
36
+ uipath_langchain-0.0.131.dist-info/METADATA,sha256=1T4chCHDVrMR97PZYal-X_kCCLeLlcb6hawfHgkpebM,4235
37
+ uipath_langchain-0.0.131.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
38
+ uipath_langchain-0.0.131.dist-info/entry_points.txt,sha256=FUtzqGOEntlJKMJIXhQUfT7ZTbQmGhke1iCmDWZaQZI,81
39
+ uipath_langchain-0.0.131.dist-info/licenses/LICENSE,sha256=JDpt-uotAkHFmxpwxi6gwx6HQ25e-lG4U_Gzcvgp7JY,1063
40
+ uipath_langchain-0.0.131.dist-info/RECORD,,