|
11 | 11 | Instead, all exports are loaded on-demand when first accessed. |
12 | 12 | """ |
13 | 13 |
|
| 14 | +from .hitl import ( |
| 15 | + request_approval, |
| 16 | + request_conversational_tool_confirmation, |
| 17 | + requires_approval, |
| 18 | +) |
| 19 | + |
14 | 20 |
|
15 | 21 | def __getattr__(name): |
16 | | - if name == "UiPathAzureChatOpenAI": |
17 | | - from .models import UiPathAzureChatOpenAI |
| 22 | + if name == "get_chat_model": |
| 23 | + from .chat_model_factory import get_chat_model |
18 | 24 |
|
19 | | - return UiPathAzureChatOpenAI |
| 25 | + return get_chat_model |
20 | 26 | if name == "UiPathChat": |
21 | | - from .models import UiPathChat |
| 27 | + from uipath_langchain_client.clients.normalized.chat_models import ( |
| 28 | + UiPathChat, |
| 29 | + ) |
22 | 30 |
|
23 | 31 | return UiPathChat |
| 32 | + if name == "UiPathAzureChatOpenAI": |
| 33 | + from uipath_langchain_client.clients.openai.chat_models import ( |
| 34 | + UiPathAzureChatOpenAI, |
| 35 | + ) |
| 36 | + |
| 37 | + return UiPathAzureChatOpenAI |
24 | 38 | if name == "UiPathChatOpenAI": |
25 | | - from .openai import UiPathChatOpenAI |
| 39 | + from uipath_langchain_client.clients.openai.chat_models import ( |
| 40 | + UiPathChatOpenAI, |
| 41 | + ) |
26 | 42 |
|
27 | 43 | return UiPathChatOpenAI |
28 | | - if name == "requires_approval": |
29 | | - from .hitl import requires_approval |
| 44 | + if name == "UiPathChatGoogleGenerativeAI": |
| 45 | + from uipath_langchain_client.clients.google.chat_models import ( |
| 46 | + UiPathChatGoogleGenerativeAI, |
| 47 | + ) |
| 48 | + |
| 49 | + return UiPathChatGoogleGenerativeAI |
| 50 | + if name == "UiPathChatBedrock": |
| 51 | + from uipath_langchain_client.clients.bedrock.chat_models import ( |
| 52 | + UiPathChatBedrock, |
| 53 | + ) |
30 | 54 |
|
31 | | - return requires_approval |
32 | | - if name in ("UiPathChatBedrock", "UiPathChatBedrockConverse"): |
33 | | - from .bedrock import UiPathChatBedrock, UiPathChatBedrockConverse |
| 55 | + return UiPathChatBedrock |
| 56 | + if name == "UiPathChatBedrockConverse": |
| 57 | + from uipath_langchain_client.clients.bedrock.chat_models import ( |
| 58 | + UiPathChatBedrockConverse, |
| 59 | + ) |
34 | 60 |
|
35 | | - if name == "UiPathChatBedrock": |
36 | | - return UiPathChatBedrock |
37 | 61 | return UiPathChatBedrockConverse |
| 62 | + if name == "UiPathChatAnthropicBedrock": |
| 63 | + from uipath_langchain_client.clients.bedrock.chat_models import ( |
| 64 | + UiPathChatAnthropicBedrock, |
| 65 | + ) |
| 66 | + |
| 67 | + return UiPathChatAnthropicBedrock |
| 68 | + if name == "UiPathChatAnthropic": |
| 69 | + from uipath_langchain_client.clients.anthropic.chat_models import ( |
| 70 | + UiPathChatAnthropic, |
| 71 | + ) |
| 72 | + |
| 73 | + return UiPathChatAnthropic |
| 74 | + if name == "UiPathChatAnthropicVertex": |
| 75 | + from uipath_langchain_client.clients.vertexai.chat_models import ( |
| 76 | + UiPathChatAnthropicVertex, |
| 77 | + ) |
| 78 | + |
| 79 | + return UiPathChatAnthropicVertex |
| 80 | + if name == "UiPathChatFireworks": |
| 81 | + from uipath_langchain_client.clients.fireworks.chat_models import ( |
| 82 | + UiPathChatFireworks, |
| 83 | + ) |
| 84 | + |
| 85 | + return UiPathChatFireworks |
38 | 86 | if name == "UiPathChatVertex": |
39 | | - from .vertex import UiPathChatVertex |
| 87 | + from uipath_langchain.chat._legacy.vertex import UiPathChatVertex |
40 | 88 |
|
41 | 89 | return UiPathChatVertex |
42 | 90 | if name in ("OpenAIModels", "BedrockModels", "GeminiModels"): |
43 | | - from . import supported_models |
| 91 | + from uipath_langchain.chat._legacy import supported_models |
44 | 92 |
|
45 | 93 | return getattr(supported_models, name) |
46 | 94 | if name in ("LLMProvider", "APIFlavor"): |
47 | | - from . import types |
| 95 | + from uipath_langchain.chat._legacy import types |
48 | 96 |
|
49 | 97 | return getattr(types, name) |
| 98 | + |
50 | 99 | raise AttributeError(f"module {__name__!r} has no attribute {name!r}") |
51 | 100 |
|
52 | 101 |
|
53 | 102 | __all__ = [ |
| 103 | + "get_chat_model", |
54 | 104 | "UiPathChat", |
55 | 105 | "UiPathAzureChatOpenAI", |
56 | 106 | "UiPathChatOpenAI", |
| 107 | + "UiPathChatGoogleGenerativeAI", |
57 | 108 | "UiPathChatBedrock", |
58 | 109 | "UiPathChatBedrockConverse", |
| 110 | + "UiPathChatAnthropicBedrock", |
| 111 | + "UiPathChatAnthropic", |
| 112 | + "UiPathChatAnthropicVertex", |
| 113 | + "UiPathChatFireworks", |
59 | 114 | "UiPathChatVertex", |
60 | 115 | "OpenAIModels", |
61 | 116 | "BedrockModels", |
62 | 117 | "GeminiModels", |
63 | | - "requires_approval", |
64 | 118 | "LLMProvider", |
65 | 119 | "APIFlavor", |
| 120 | + "request_approval", |
| 121 | + "request_conversational_tool_confirmation", |
| 122 | + "requires_approval", |
66 | 123 | ] |
0 commit comments