beamlit 0.0.60rc126__py3-none-any.whl → 0.0.60rc128__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.
@@ -96,52 +96,7 @@ class ClientCredentials(Auth):
96
96
  Raises:
97
97
  Exception: If token refresh fails.
98
98
  """
99
- err = self.do_refresh()
100
- if err:
101
- return err
102
-
99
+ self.get_token()
103
100
  request.headers["X-Beamlit-Authorization"] = f"Bearer {self.credentials.access_token}"
104
101
  request.headers["X-Beamlit-Workspace"] = self.workspace_name
105
- yield request
106
-
107
- def do_refresh(self) -> Optional[Exception]:
108
- """
109
- Performs the token refresh using the refresh token.
110
-
111
- Returns:
112
- Optional[Exception]: An exception if refreshing fails, otherwise None.
113
- """
114
- if not self.credentials.refresh_token:
115
- return Exception("No refresh token to refresh")
116
-
117
- url = f"{self.base_url}/oauth/token"
118
- refresh_data = {
119
- "grant_type": "refresh_token",
120
- "refresh_token": self.credentials.refresh_token,
121
- "device_code": self.credentials.device_code,
122
- "client_id": "beamlit",
123
- }
124
-
125
- try:
126
- response = post(url, json=refresh_data, headers={"Content-Type": "application/json"})
127
- response.raise_for_status()
128
- finalize_response = DeviceLoginFinalizeResponse(**response.json())
129
-
130
- if not finalize_response.refresh_token:
131
- finalize_response.refresh_token = self.credentials.refresh_token
132
-
133
- from .credentials import Credentials, save_credentials
134
-
135
- creds = Credentials(
136
- access_token=finalize_response.access_token,
137
- refresh_token=finalize_response.refresh_token,
138
- expires_in=finalize_response.expires_in,
139
- device_code=self.credentials.device_code,
140
- )
141
-
142
- self.credentials = creds
143
- save_credentials(self.workspace_name, creds)
144
- return None
145
-
146
- except Exception as e:
147
- return Exception(f"Failed to refresh token: {str(e)}")
102
+ yield request
@@ -42,7 +42,7 @@ class LocalToolKit:
42
42
  raise RuntimeError(f"Failed to initialize local function: {e}")
43
43
 
44
44
  async def get_tools(self) -> list[BaseTool]:
45
- mcp_client = MCPClient(self.client, self._function.spec["configurations"]["url"])
46
- mcp_toolkit = MCPToolkit(client=mcp_client)
45
+ mcp_client = MCPClient(self.client, self._function.spec["configurations"]["url"], None)
46
+ mcp_toolkit = MCPToolkit(client=mcp_client, url=self._function.spec["configurations"]["url"])
47
47
  await mcp_toolkit.initialize()
48
48
  return await mcp_toolkit.get_tools()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: beamlit
3
- Version: 0.0.60rc126
3
+ Version: 0.0.60rc128
4
4
  Summary: Add your description here
5
5
  Author-email: cploujoux <ch.ploujoux@gmail.com>
6
6
  License-File: LICENSE
@@ -115,7 +115,7 @@ beamlit/api/workspaces/update_workspace_user_role.py,sha256=Yn9iuJ4tKtauzBiJyU4-
115
115
  beamlit/authentication/__init__.py,sha256=wiXqRbc7E-ulrH_ueA9duOGFvXeo7-RvhSD1XbFogMo,1020
116
116
  beamlit/authentication/apikey.py,sha256=Q3Kz4Zbc_Lr6lYwiwiLo6AhggKcdqsd6xJjDi-nERiI,1557
117
117
  beamlit/authentication/authentication.py,sha256=OgqS6YciBnh0MomeEaL2YuZt1fHPOfQUkRhsIu6tcvk,5812
118
- beamlit/authentication/clientcredentials.py,sha256=oKopOql7nugarWwcuJ_2mGaPODuIsixnxyX2I-yRTGM,5191
118
+ beamlit/authentication/clientcredentials.py,sha256=4D918PA8hZWr3_KiT5iEcF8d7E3kKNDb0UVx3S2iTe0,3585
119
119
  beamlit/authentication/credentials.py,sha256=YNMCRpNa2Cs7lN647Sz4-8LxfZtJPhSyyxCVwNzTAxo,8741
120
120
  beamlit/authentication/device_mode.py,sha256=gBJqJpWQXEG8gZbWXhlvQyk8FfHH95-aqURUnudil-4,6526
121
121
  beamlit/common/__init__.py,sha256=saX5X3hRCJ9erSlXuSkZ2VGgquvpgdcofAU_9sM4bCE,354
@@ -133,7 +133,7 @@ beamlit/deploy/parser.py,sha256=gjRUhOVtfKnc1UNc_FhXsEfj9zrMNuq8W93pNsJBpo0,7586
133
133
  beamlit/functions/__init__.py,sha256=Mnoqpa1dm7TXwjodBbF_40JyD78aXsOYWmqjDSnA1lU,317
134
134
  beamlit/functions/common.py,sha256=v4nmLP9Wotpb5e6hV30XbItgZjr5lwXcF0EOotxRngI,10127
135
135
  beamlit/functions/decorator.py,sha256=iQbLwUo0K83DFJ3ub8O5jKtkbSINnku6GZcKJ9h7-5E,2292
136
- beamlit/functions/local/local.py,sha256=ZKjqSC9UxLASRkrb_WCxDDEzlZR3I0s9HX2HvGciONw,1841
136
+ beamlit/functions/local/local.py,sha256=qkd-RGObyjZD0KIwaze_TnTuiJ3lyluCcM97nbyPNBk,1897
137
137
  beamlit/functions/mcp/client.py,sha256=enLo0dzWMBHJEQf6as3UWM8tN3CjUN1YO3UPn67DLac,4072
138
138
  beamlit/functions/mcp/mcp.py,sha256=voZYIbsHipSCEKXmnU_3uYKa_cfT1M2mv5t1pEwUkkE,6040
139
139
  beamlit/functions/mcp/utils.py,sha256=V7bah6cymdtjJ_LJUrNcHDeApDHA6uXvaGVeFJGKj2U,1850
@@ -254,8 +254,8 @@ beamlit/serve/app.py,sha256=5XZci-R95Zjl97wMtQd1BRtonnkJJ2AeoTVFPKGAOfA,4283
254
254
  beamlit/serve/middlewares/__init__.py,sha256=O7fyfE1DIYmajFY9WWdzxCgeAQWZzJfeUjzHGbpWaAk,309
255
255
  beamlit/serve/middlewares/accesslog.py,sha256=lcu33j4epFSHRBaeTpyt8deNb3kaM3K91-andw4fp80,1112
256
256
  beamlit/serve/middlewares/processtime.py,sha256=3x5w1yQexB0xFNKK6fgLbINxT-eLLunfZ6UDV0bIIF4,944
257
- beamlit-0.0.60rc126.dist-info/METADATA,sha256=sY4PdMGwk2yyafS7uFrczuSxDFKJssubyg_XRm3exII,3547
258
- beamlit-0.0.60rc126.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
259
- beamlit-0.0.60rc126.dist-info/entry_points.txt,sha256=zxhgdn7SP-Otk4rEv7LMPAAa9w4TUCLbu9TJi9-K3xg,115
260
- beamlit-0.0.60rc126.dist-info/licenses/LICENSE,sha256=p5PNQvpvyDT_0aYBDgmV1fFI_vAD2aSV0wWG7VTgRis,1069
261
- beamlit-0.0.60rc126.dist-info/RECORD,,
257
+ beamlit-0.0.60rc128.dist-info/METADATA,sha256=B3MFxSnd094ye9cY7XsjIi7NU_k-jrm9fwgRYPPGL7E,3547
258
+ beamlit-0.0.60rc128.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
259
+ beamlit-0.0.60rc128.dist-info/entry_points.txt,sha256=zxhgdn7SP-Otk4rEv7LMPAAa9w4TUCLbu9TJi9-K3xg,115
260
+ beamlit-0.0.60rc128.dist-info/licenses/LICENSE,sha256=p5PNQvpvyDT_0aYBDgmV1fFI_vAD2aSV0wWG7VTgRis,1069
261
+ beamlit-0.0.60rc128.dist-info/RECORD,,