beamlit 0.0.54rc101__py3-none-any.whl → 0.0.55rc103__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.
Files changed (34) hide show
  1. beamlit/agents/chain.py +2 -1
  2. beamlit/agents/chat.py +2 -1
  3. beamlit/agents/decorator.py +3 -2
  4. beamlit/api/integrations/get_integration_connection_model.py +2 -2
  5. beamlit/api/integrations/{list_integration_models.py → get_integration_connection_model_endpoint_configurations.py} +12 -12
  6. beamlit/api/{default/create_account.py → knowledgebases/create_knowledgebase.py} +30 -30
  7. beamlit/api/{accounts/delete_account.py → knowledgebases/delete_knowledgebase.py} +57 -43
  8. beamlit/api/{accounts/get_account.py → knowledgebases/get_knowledgebase.py} +56 -35
  9. beamlit/api/{accounts/list_accounts.py → knowledgebases/list_knowledgebases.py} +57 -25
  10. beamlit/api/{accounts/update_account.py → knowledgebases/update_knowledgebase.py} +43 -43
  11. beamlit/deploy/deploy.py +2 -0
  12. beamlit/deploy/format.py +1 -68
  13. beamlit/models/__init__.py +8 -10
  14. beamlit/models/agent_chain.py +9 -0
  15. beamlit/models/agent_spec.py +10 -1
  16. beamlit/models/integration_model.py +27 -9
  17. beamlit/models/knowledgebase.py +126 -0
  18. beamlit/models/knowledgebase_release.py +70 -0
  19. beamlit/models/knowledgebase_spec.py +143 -0
  20. beamlit/models/{account_spec_address.py → knowledgebase_spec_options.py} +6 -6
  21. beamlit/models/model_spec.py +9 -0
  22. beamlit/models/runtime.py +21 -2
  23. beamlit/models/store_agent.py +9 -0
  24. {beamlit-0.0.54rc101.dist-info → beamlit-0.0.55rc103.dist-info}/METADATA +1 -1
  25. {beamlit-0.0.54rc101.dist-info → beamlit-0.0.55rc103.dist-info}/RECORD +29 -31
  26. beamlit/api/integrations/get_integration_model.py +0 -104
  27. beamlit/models/account.py +0 -224
  28. beamlit/models/account_metadata.py +0 -121
  29. beamlit/models/account_spec.py +0 -123
  30. beamlit/models/billing_address.py +0 -133
  31. /beamlit/api/{accounts → knowledgebases}/__init__.py +0 -0
  32. {beamlit-0.0.54rc101.dist-info → beamlit-0.0.55rc103.dist-info}/WHEEL +0 -0
  33. {beamlit-0.0.54rc101.dist-info → beamlit-0.0.55rc103.dist-info}/entry_points.txt +0 -0
  34. {beamlit-0.0.54rc101.dist-info → beamlit-0.0.55rc103.dist-info}/licenses/LICENSE +0 -0
@@ -5,24 +5,33 @@ import httpx
5
5
 
6
6
  from ... import errors
7
7
  from ...client import AuthenticatedClient, Client
8
- from ...models.account import Account
9
- from ...types import Response
8
+ from ...models.knowledgebase import Knowledgebase
9
+ from ...types import UNSET, Response, Unset
10
10
 
11
11
 
12
12
  def _get_kwargs(
13
- account_id: str,
13
+ knowledgebase_id: str,
14
+ *,
15
+ environment: Union[Unset, str] = UNSET,
14
16
  ) -> dict[str, Any]:
17
+ params: dict[str, Any] = {}
18
+
19
+ params["environment"] = environment
20
+
21
+ params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
22
+
15
23
  _kwargs: dict[str, Any] = {
16
24
  "method": "get",
17
- "url": f"/accounts/{account_id}",
25
+ "url": f"/knowledgebases/{knowledgebase_id}",
26
+ "params": params,
18
27
  }
19
28
 
20
29
  return _kwargs
21
30
 
22
31
 
23
- def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Account]:
32
+ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Knowledgebase]:
24
33
  if response.status_code == 200:
25
- response_200 = Account.from_dict(response.json())
34
+ response_200 = Knowledgebase.from_dict(response.json())
26
35
 
27
36
  return response_200
28
37
  if client.raise_on_unexpected_status:
@@ -31,7 +40,7 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt
31
40
  return None
32
41
 
33
42
 
34
- def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Account]:
43
+ def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Knowledgebase]:
35
44
  return Response(
36
45
  status_code=HTTPStatus(response.status_code),
37
46
  content=response.content,
@@ -41,27 +50,30 @@ def _build_response(*, client: Union[AuthenticatedClient, Client], response: htt
41
50
 
42
51
 
43
52
  def sync_detailed(
44
- account_id: str,
53
+ knowledgebase_id: str,
45
54
  *,
46
55
  client: AuthenticatedClient,
47
- ) -> Response[Account]:
48
- """Get account by name
56
+ environment: Union[Unset, str] = UNSET,
57
+ ) -> Response[Knowledgebase]:
58
+ """Get knowledgebase
49
59
 
50
- Returns an account by name.
60
+ Returns an knowledgebase by ID.
51
61
 
52
62
  Args:
53
- account_id (str):
63
+ knowledgebase_id (str):
64
+ environment (Union[Unset, str]):
54
65
 
55
66
  Raises:
56
67
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
57
68
  httpx.TimeoutException: If the request takes longer than Client.timeout.
58
69
 
59
70
  Returns:
60
- Response[Account]
71
+ Response[Knowledgebase]
61
72
  """
62
73
 
63
74
  kwargs = _get_kwargs(
64
- account_id=account_id,
75
+ knowledgebase_id=knowledgebase_id,
76
+ environment=environment,
65
77
  )
66
78
 
67
79
  response = client.get_httpx_client().request(
@@ -72,53 +84,59 @@ def sync_detailed(
72
84
 
73
85
 
74
86
  def sync(
75
- account_id: str,
87
+ knowledgebase_id: str,
76
88
  *,
77
89
  client: AuthenticatedClient,
78
- ) -> Optional[Account]:
79
- """Get account by name
90
+ environment: Union[Unset, str] = UNSET,
91
+ ) -> Optional[Knowledgebase]:
92
+ """Get knowledgebase
80
93
 
81
- Returns an account by name.
94
+ Returns an knowledgebase by ID.
82
95
 
83
96
  Args:
84
- account_id (str):
97
+ knowledgebase_id (str):
98
+ environment (Union[Unset, str]):
85
99
 
86
100
  Raises:
87
101
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
88
102
  httpx.TimeoutException: If the request takes longer than Client.timeout.
89
103
 
90
104
  Returns:
91
- Account
105
+ Knowledgebase
92
106
  """
93
107
 
94
108
  return sync_detailed(
95
- account_id=account_id,
109
+ knowledgebase_id=knowledgebase_id,
96
110
  client=client,
111
+ environment=environment,
97
112
  ).parsed
98
113
 
99
114
 
100
115
  async def asyncio_detailed(
101
- account_id: str,
116
+ knowledgebase_id: str,
102
117
  *,
103
118
  client: AuthenticatedClient,
104
- ) -> Response[Account]:
105
- """Get account by name
119
+ environment: Union[Unset, str] = UNSET,
120
+ ) -> Response[Knowledgebase]:
121
+ """Get knowledgebase
106
122
 
107
- Returns an account by name.
123
+ Returns an knowledgebase by ID.
108
124
 
109
125
  Args:
110
- account_id (str):
126
+ knowledgebase_id (str):
127
+ environment (Union[Unset, str]):
111
128
 
112
129
  Raises:
113
130
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
114
131
  httpx.TimeoutException: If the request takes longer than Client.timeout.
115
132
 
116
133
  Returns:
117
- Response[Account]
134
+ Response[Knowledgebase]
118
135
  """
119
136
 
120
137
  kwargs = _get_kwargs(
121
- account_id=account_id,
138
+ knowledgebase_id=knowledgebase_id,
139
+ environment=environment,
122
140
  )
123
141
 
124
142
  response = await client.get_async_httpx_client().request(**kwargs)
@@ -127,28 +145,31 @@ async def asyncio_detailed(
127
145
 
128
146
 
129
147
  async def asyncio(
130
- account_id: str,
148
+ knowledgebase_id: str,
131
149
  *,
132
150
  client: AuthenticatedClient,
133
- ) -> Optional[Account]:
134
- """Get account by name
151
+ environment: Union[Unset, str] = UNSET,
152
+ ) -> Optional[Knowledgebase]:
153
+ """Get knowledgebase
135
154
 
136
- Returns an account by name.
155
+ Returns an knowledgebase by ID.
137
156
 
138
157
  Args:
139
- account_id (str):
158
+ knowledgebase_id (str):
159
+ environment (Union[Unset, str]):
140
160
 
141
161
  Raises:
142
162
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
143
163
  httpx.TimeoutException: If the request takes longer than Client.timeout.
144
164
 
145
165
  Returns:
146
- Account
166
+ Knowledgebase
147
167
  """
148
168
 
149
169
  return (
150
170
  await asyncio_detailed(
151
- account_id=account_id,
171
+ knowledgebase_id=knowledgebase_id,
152
172
  client=client,
173
+ environment=environment,
153
174
  )
154
175
  ).parsed
@@ -5,14 +5,24 @@ import httpx
5
5
 
6
6
  from ... import errors
7
7
  from ...client import AuthenticatedClient, Client
8
- from ...models.account import Account
9
- from ...types import Response
8
+ from ...models.knowledgebase import Knowledgebase
9
+ from ...types import UNSET, Response, Unset
10
10
 
11
11
 
12
- def _get_kwargs() -> dict[str, Any]:
12
+ def _get_kwargs(
13
+ *,
14
+ environment: Union[Unset, str] = UNSET,
15
+ ) -> dict[str, Any]:
16
+ params: dict[str, Any] = {}
17
+
18
+ params["environment"] = environment
19
+
20
+ params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
21
+
13
22
  _kwargs: dict[str, Any] = {
14
23
  "method": "get",
15
- "url": "/accounts",
24
+ "url": "/knowledgebases",
25
+ "params": params,
16
26
  }
17
27
 
18
28
  return _kwargs
@@ -20,12 +30,12 @@ def _get_kwargs() -> dict[str, Any]:
20
30
 
21
31
  def _parse_response(
22
32
  *, client: Union[AuthenticatedClient, Client], response: httpx.Response
23
- ) -> Optional[list["Account"]]:
33
+ ) -> Optional[list["Knowledgebase"]]:
24
34
  if response.status_code == 200:
25
35
  response_200 = []
26
36
  _response_200 = response.json()
27
37
  for response_200_item_data in _response_200:
28
- response_200_item = Account.from_dict(response_200_item_data)
38
+ response_200_item = Knowledgebase.from_dict(response_200_item_data)
29
39
 
30
40
  response_200.append(response_200_item)
31
41
 
@@ -38,7 +48,7 @@ def _parse_response(
38
48
 
39
49
  def _build_response(
40
50
  *, client: Union[AuthenticatedClient, Client], response: httpx.Response
41
- ) -> Response[list["Account"]]:
51
+ ) -> Response[list["Knowledgebase"]]:
42
52
  return Response(
43
53
  status_code=HTTPStatus(response.status_code),
44
54
  content=response.content,
@@ -50,20 +60,26 @@ def _build_response(
50
60
  def sync_detailed(
51
61
  *,
52
62
  client: AuthenticatedClient,
53
- ) -> Response[list["Account"]]:
54
- """List accounts
63
+ environment: Union[Unset, str] = UNSET,
64
+ ) -> Response[list["Knowledgebase"]]:
65
+ """List knowledgebases
66
+
67
+ Returns a list of all knowledgebases in the workspace.
55
68
 
56
- Returns a list of all accounts.
69
+ Args:
70
+ environment (Union[Unset, str]):
57
71
 
58
72
  Raises:
59
73
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
60
74
  httpx.TimeoutException: If the request takes longer than Client.timeout.
61
75
 
62
76
  Returns:
63
- Response[list['Account']]
77
+ Response[list['Knowledgebase']]
64
78
  """
65
79
 
66
- kwargs = _get_kwargs()
80
+ kwargs = _get_kwargs(
81
+ environment=environment,
82
+ )
67
83
 
68
84
  response = client.get_httpx_client().request(
69
85
  **kwargs,
@@ -75,41 +91,52 @@ def sync_detailed(
75
91
  def sync(
76
92
  *,
77
93
  client: AuthenticatedClient,
78
- ) -> Optional[list["Account"]]:
79
- """List accounts
94
+ environment: Union[Unset, str] = UNSET,
95
+ ) -> Optional[list["Knowledgebase"]]:
96
+ """List knowledgebases
97
+
98
+ Returns a list of all knowledgebases in the workspace.
80
99
 
81
- Returns a list of all accounts.
100
+ Args:
101
+ environment (Union[Unset, str]):
82
102
 
83
103
  Raises:
84
104
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
85
105
  httpx.TimeoutException: If the request takes longer than Client.timeout.
86
106
 
87
107
  Returns:
88
- list['Account']
108
+ list['Knowledgebase']
89
109
  """
90
110
 
91
111
  return sync_detailed(
92
112
  client=client,
113
+ environment=environment,
93
114
  ).parsed
94
115
 
95
116
 
96
117
  async def asyncio_detailed(
97
118
  *,
98
119
  client: AuthenticatedClient,
99
- ) -> Response[list["Account"]]:
100
- """List accounts
120
+ environment: Union[Unset, str] = UNSET,
121
+ ) -> Response[list["Knowledgebase"]]:
122
+ """List knowledgebases
123
+
124
+ Returns a list of all knowledgebases in the workspace.
101
125
 
102
- Returns a list of all accounts.
126
+ Args:
127
+ environment (Union[Unset, str]):
103
128
 
104
129
  Raises:
105
130
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
106
131
  httpx.TimeoutException: If the request takes longer than Client.timeout.
107
132
 
108
133
  Returns:
109
- Response[list['Account']]
134
+ Response[list['Knowledgebase']]
110
135
  """
111
136
 
112
- kwargs = _get_kwargs()
137
+ kwargs = _get_kwargs(
138
+ environment=environment,
139
+ )
113
140
 
114
141
  response = await client.get_async_httpx_client().request(**kwargs)
115
142
 
@@ -119,21 +146,26 @@ async def asyncio_detailed(
119
146
  async def asyncio(
120
147
  *,
121
148
  client: AuthenticatedClient,
122
- ) -> Optional[list["Account"]]:
123
- """List accounts
149
+ environment: Union[Unset, str] = UNSET,
150
+ ) -> Optional[list["Knowledgebase"]]:
151
+ """List knowledgebases
152
+
153
+ Returns a list of all knowledgebases in the workspace.
124
154
 
125
- Returns a list of all accounts.
155
+ Args:
156
+ environment (Union[Unset, str]):
126
157
 
127
158
  Raises:
128
159
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
129
160
  httpx.TimeoutException: If the request takes longer than Client.timeout.
130
161
 
131
162
  Returns:
132
- list['Account']
163
+ list['Knowledgebase']
133
164
  """
134
165
 
135
166
  return (
136
167
  await asyncio_detailed(
137
168
  client=client,
169
+ environment=environment,
138
170
  )
139
171
  ).parsed
@@ -5,20 +5,20 @@ import httpx
5
5
 
6
6
  from ... import errors
7
7
  from ...client import AuthenticatedClient, Client
8
- from ...models.account import Account
8
+ from ...models.knowledgebase import Knowledgebase
9
9
  from ...types import Response
10
10
 
11
11
 
12
12
  def _get_kwargs(
13
- account_id: str,
13
+ knowledgebase_id: str,
14
14
  *,
15
- body: Account,
15
+ body: Knowledgebase,
16
16
  ) -> dict[str, Any]:
17
17
  headers: dict[str, Any] = {}
18
18
 
19
19
  _kwargs: dict[str, Any] = {
20
20
  "method": "put",
21
- "url": f"/accounts/{account_id}",
21
+ "url": f"/knowledgebases/{knowledgebase_id}",
22
22
  }
23
23
 
24
24
  _body = body.to_dict()
@@ -30,9 +30,9 @@ def _get_kwargs(
30
30
  return _kwargs
31
31
 
32
32
 
33
- def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Account]:
33
+ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Knowledgebase]:
34
34
  if response.status_code == 200:
35
- response_200 = Account.from_dict(response.json())
35
+ response_200 = Knowledgebase.from_dict(response.json())
36
36
 
37
37
  return response_200
38
38
  if client.raise_on_unexpected_status:
@@ -41,7 +41,7 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt
41
41
  return None
42
42
 
43
43
 
44
- def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Account]:
44
+ def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Knowledgebase]:
45
45
  return Response(
46
46
  status_code=HTTPStatus(response.status_code),
47
47
  content=response.content,
@@ -51,29 +51,29 @@ def _build_response(*, client: Union[AuthenticatedClient, Client], response: htt
51
51
 
52
52
 
53
53
  def sync_detailed(
54
- account_id: str,
54
+ knowledgebase_id: str,
55
55
  *,
56
56
  client: AuthenticatedClient,
57
- body: Account,
58
- ) -> Response[Account]:
59
- """Update account
57
+ body: Knowledgebase,
58
+ ) -> Response[Knowledgebase]:
59
+ """Update knowledgebase
60
60
 
61
- Updates an account by name.
61
+ Updates an knowledgebase.
62
62
 
63
63
  Args:
64
- account_id (str):
65
- body (Account): Account
64
+ knowledgebase_id (str):
65
+ body (Knowledgebase): Knowledgebase
66
66
 
67
67
  Raises:
68
68
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
69
69
  httpx.TimeoutException: If the request takes longer than Client.timeout.
70
70
 
71
71
  Returns:
72
- Response[Account]
72
+ Response[Knowledgebase]
73
73
  """
74
74
 
75
75
  kwargs = _get_kwargs(
76
- account_id=account_id,
76
+ knowledgebase_id=knowledgebase_id,
77
77
  body=body,
78
78
  )
79
79
 
@@ -85,58 +85,58 @@ def sync_detailed(
85
85
 
86
86
 
87
87
  def sync(
88
- account_id: str,
88
+ knowledgebase_id: str,
89
89
  *,
90
90
  client: AuthenticatedClient,
91
- body: Account,
92
- ) -> Optional[Account]:
93
- """Update account
91
+ body: Knowledgebase,
92
+ ) -> Optional[Knowledgebase]:
93
+ """Update knowledgebase
94
94
 
95
- Updates an account by name.
95
+ Updates an knowledgebase.
96
96
 
97
97
  Args:
98
- account_id (str):
99
- body (Account): Account
98
+ knowledgebase_id (str):
99
+ body (Knowledgebase): Knowledgebase
100
100
 
101
101
  Raises:
102
102
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
103
103
  httpx.TimeoutException: If the request takes longer than Client.timeout.
104
104
 
105
105
  Returns:
106
- Account
106
+ Knowledgebase
107
107
  """
108
108
 
109
109
  return sync_detailed(
110
- account_id=account_id,
110
+ knowledgebase_id=knowledgebase_id,
111
111
  client=client,
112
112
  body=body,
113
113
  ).parsed
114
114
 
115
115
 
116
116
  async def asyncio_detailed(
117
- account_id: str,
117
+ knowledgebase_id: str,
118
118
  *,
119
119
  client: AuthenticatedClient,
120
- body: Account,
121
- ) -> Response[Account]:
122
- """Update account
120
+ body: Knowledgebase,
121
+ ) -> Response[Knowledgebase]:
122
+ """Update knowledgebase
123
123
 
124
- Updates an account by name.
124
+ Updates an knowledgebase.
125
125
 
126
126
  Args:
127
- account_id (str):
128
- body (Account): Account
127
+ knowledgebase_id (str):
128
+ body (Knowledgebase): Knowledgebase
129
129
 
130
130
  Raises:
131
131
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
132
132
  httpx.TimeoutException: If the request takes longer than Client.timeout.
133
133
 
134
134
  Returns:
135
- Response[Account]
135
+ Response[Knowledgebase]
136
136
  """
137
137
 
138
138
  kwargs = _get_kwargs(
139
- account_id=account_id,
139
+ knowledgebase_id=knowledgebase_id,
140
140
  body=body,
141
141
  )
142
142
 
@@ -146,30 +146,30 @@ async def asyncio_detailed(
146
146
 
147
147
 
148
148
  async def asyncio(
149
- account_id: str,
149
+ knowledgebase_id: str,
150
150
  *,
151
151
  client: AuthenticatedClient,
152
- body: Account,
153
- ) -> Optional[Account]:
154
- """Update account
152
+ body: Knowledgebase,
153
+ ) -> Optional[Knowledgebase]:
154
+ """Update knowledgebase
155
155
 
156
- Updates an account by name.
156
+ Updates an knowledgebase.
157
157
 
158
158
  Args:
159
- account_id (str):
160
- body (Account): Account
159
+ knowledgebase_id (str):
160
+ body (Knowledgebase): Knowledgebase
161
161
 
162
162
  Raises:
163
163
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
164
164
  httpx.TimeoutException: If the request takes longer than Client.timeout.
165
165
 
166
166
  Returns:
167
- Account
167
+ Knowledgebase
168
168
  """
169
169
 
170
170
  return (
171
171
  await asyncio_detailed(
172
- account_id=account_id,
172
+ knowledgebase_id=knowledgebase_id,
173
173
  client=client,
174
174
  body=body,
175
175
  )
beamlit/deploy/deploy.py CHANGED
@@ -77,6 +77,8 @@ def get_beamlit_deployment_from_resource(
77
77
  metadata = EnvironmentMetadata(**value.get("metadata", {}))
78
78
  spec = AgentSpec(**value.get("spec", {}))
79
79
  agent = Agent(metadata=metadata, spec=spec)
80
+ if not agent.spec.prompt:
81
+ agent.spec.prompt = get_description(None, resource)
80
82
  return set_default_values(resource, agent)
81
83
  if arg.arg == "function":
82
84
  if isinstance(arg.value, ast.Dict):
beamlit/deploy/format.py CHANGED
@@ -5,8 +5,6 @@ It includes functions to convert arguments, parameters, dictionaries, and agent
5
5
 
6
6
  import ast
7
7
 
8
- from beamlit.models import AgentChain, StoreFunctionParameter
9
-
10
8
 
11
9
  def arg_to_list(arg: ast.List):
12
10
  value = []
@@ -45,69 +43,4 @@ def arg_to_dict(arg: ast.keyword):
45
43
  for k, v in zip(arg.keys, arg.values):
46
44
  if isinstance(k, ast.Constant):
47
45
  value[k.value] = format_value(v)
48
- return value
49
-
50
- def format_parameters(parameters: list[StoreFunctionParameter]) -> str:
51
- """
52
- Formats function parameters into a YAML-compatible string.
53
-
54
- Args:
55
- parameters (list[StoreFunctionParameter]): List of parameter objects.
56
-
57
- Returns:
58
- str: YAML-formatted string of parameters.
59
- """
60
- if not parameters:
61
- return "[]"
62
-
63
- formatted = []
64
- for param in parameters:
65
- formatted.append(f"""
66
- - name: {param.name}
67
- type: {param.type_}
68
- required: {str(param.required).lower()}
69
- description: {param.description}""")
70
-
71
- return "\n".join(formatted)
72
-
73
- def format_dict(obj: dict) -> str:
74
- """
75
- Converts a dictionary to a YAML-compatible string.
76
-
77
- Args:
78
- obj (dict): The dictionary to format.
79
-
80
- Returns:
81
- str: YAML-formatted string representation of the dictionary.
82
- """
83
- if not obj:
84
- return "null"
85
- ret = ""
86
- for k, v in obj.items():
87
- if not v:
88
- ret += f"{k}: null\n"
89
- else:
90
- ret += f"{k}: {v}\n"
91
- return ret
92
-
93
- def format_agent_chain(agentChain: list[AgentChain]) -> str:
94
- """
95
- Formats agent chain configuration into a YAML-compatible string.
96
-
97
- Args:
98
- agentChain (list[AgentChain]): List of agent chain configurations.
99
-
100
- Returns:
101
- str: YAML-formatted string of agent chain.
102
- """
103
- if not agentChain:
104
- return "[]"
105
- formatted = []
106
-
107
- for agent in agentChain:
108
- formatted.append(f"""
109
- - agent: {agent.name}
110
- enabled: {agent.enabled}""")
111
- if agent.description:
112
- formatted.append(f" description: {agent.description}")
113
- return "\n".join(formatted)
46
+ return value