beamlit 0.0.43__py3-none-any.whl → 0.0.44__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.
beamlit/agents/chat.py CHANGED
@@ -48,6 +48,20 @@ def get_deepseek_chat_model(**kwargs):
48
48
 
49
49
  return ChatDeepSeek(**kwargs)
50
50
 
51
+ def get_azure_ai_inference_chat_model(**kwargs):
52
+ from langchain_openai import ChatOpenAI # type: ignore
53
+
54
+ return ChatOpenAI(
55
+ **kwargs
56
+ ) # It uses a compatible endpoint, so we can use the ChatOpenAI interface
57
+
58
+ def get_azure_marketplace_chat_model(**kwargs):
59
+ from langchain_openai import OpenAI # type: ignore
60
+
61
+ return OpenAI(
62
+ **kwargs
63
+ ) # It seems to use a compatible endpoint, so we can use the classic OpenAI interface
64
+
51
65
  def get_chat_model(name: str, agent_model: Union[Model, None] = None) -> BaseChatModel:
52
66
  [chat_model, _, __] = get_chat_model_full(name, agent_model)
53
67
  return chat_model
@@ -110,6 +124,16 @@ def get_chat_model_full(name: str, agent_model: Union[Model, None] = None) -> Tu
110
124
  "api_key": jwt,
111
125
  },
112
126
  },
127
+ "azure-ai-inference": {
128
+ "func": get_azure_ai_inference_chat_model,
129
+ "kwargs": {
130
+ "base_url": get_base_url(name).replace("/v1", ""),
131
+ },
132
+ },
133
+ "azure-marketplace": {
134
+ "func": get_azure_marketplace_chat_model,
135
+ "kwargs": {},
136
+ },
113
137
  }
114
138
 
115
139
  provider = (
@@ -136,7 +136,12 @@ def agent(
136
136
  "@function()\n"
137
137
  "def hello_world(query: str):\n"
138
138
  " return 'Hello, world!'\n")
139
- _agent = create_react_agent(chat_model, functions, checkpointer=memory)
139
+ try:
140
+ _agent = create_react_agent(chat_model, functions, checkpointer=memory)
141
+ except AttributeError: # special case for azure-marketplace where it uses the old OpenAI interface (no tools)
142
+ logger.warning("Using the old OpenAI interface for Azure Marketplace, no tools available")
143
+ _agent = create_react_agent(chat_model, [], checkpointer=memory)
144
+
140
145
  settings.agent.agent = _agent
141
146
  else:
142
147
  settings.agent.agent = override_agent
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: beamlit
3
- Version: 0.0.43
3
+ Version: 0.0.44
4
4
  Summary: Add your description here
5
5
  Author-email: cploujoux <ch.ploujoux@gmail.com>
6
6
  License-File: LICENSE
@@ -6,8 +6,8 @@ beamlit/run.py,sha256=HtDYDjD7oVfQ8r3T5_t4qN5UDJOJfsQILi45Z21ArAg,1446
6
6
  beamlit/types.py,sha256=E1hhDh_zXfsSQ0NCt9-uw90_Mr5iIlsdfnfvxv5HarU,1005
7
7
  beamlit/agents/__init__.py,sha256=bWsFaXUbAps3IsL3Prti89m1s714vICXodbQi77h3vY,206
8
8
  beamlit/agents/chain.py,sha256=vfCjiFHuu02uTTGicxMlFzjyICQkIjpXrBGs-7uJEsg,2826
9
- beamlit/agents/chat.py,sha256=6iZuaP25hUvrKdth-6sbtqxkZ1wM0Fv13eRttxNZlIU,4715
10
- beamlit/agents/decorator.py,sha256=R5evLoproCgYjKXmH-Vq31r6G2lzZvUitXD1NoTflcA,6014
9
+ beamlit/agents/chat.py,sha256=4R_mKeGvVXluQ5r-pnN3YaqhE3lFuetyos4zUBLnLnE,5510
10
+ beamlit/agents/decorator.py,sha256=2FCOecAOVWBvvTMqkUmXxmtOwI2qTMVHUjVsqqCa8L0,6360
11
11
  beamlit/agents/thread.py,sha256=LN5Ss-uOf5_hdB0WV1dqpn-N-pDJB3C2hUvlCzdqtdk,519
12
12
  beamlit/api/__init__.py,sha256=zTSiG_ujSjAqWPyc435YXaX9XTlpMjiJWBbV-f-YtdA,45
13
13
  beamlit/api/agents/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -278,7 +278,7 @@ beamlit/serve/app.py,sha256=ROS_tb9cO4GvOQKCwloyAzpYraTdIb3oG6sChXikeNw,3285
278
278
  beamlit/serve/middlewares/__init__.py,sha256=1dVmnOmhAQWvWktqHkKSIX-YoF6fmMU8xkUQuhg_rJU,148
279
279
  beamlit/serve/middlewares/accesslog.py,sha256=Mu4T4_9OvHybjA0ApzZFpgi2C8f3X1NbUk-76v634XM,631
280
280
  beamlit/serve/middlewares/processtime.py,sha256=lDAaIasZ4bwvN-HKHvZpaD9r-yrkVNZYx4abvbjbrCg,411
281
- beamlit-0.0.43.dist-info/METADATA,sha256=Ys4fQPfeQW9oMY_2LSpycE1PXbU4efFn2OEy_0QrZ4g,3733
282
- beamlit-0.0.43.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
283
- beamlit-0.0.43.dist-info/licenses/LICENSE,sha256=p5PNQvpvyDT_0aYBDgmV1fFI_vAD2aSV0wWG7VTgRis,1069
284
- beamlit-0.0.43.dist-info/RECORD,,
281
+ beamlit-0.0.44.dist-info/METADATA,sha256=HQExKWELsmaHruDCZ8Zr-WthqrsFulBSVQhFbUeyXcQ,3733
282
+ beamlit-0.0.44.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
283
+ beamlit-0.0.44.dist-info/licenses/LICENSE,sha256=p5PNQvpvyDT_0aYBDgmV1fFI_vAD2aSV0wWG7VTgRis,1069
284
+ beamlit-0.0.44.dist-info/RECORD,,