refac
This commit is contained in:
1 parent
7ea7680f56
commit
517cd8d102
45 files changed
+1293
-969
No files matched your search
@@ -144,7 +144,8 @@ async def set_connections_config(
|
||||
request,
|
||||
EVENTS.CONFIG_CONNECTIONS_UPDATED,
|
||||
actor=user,
|
||||
subject_id='connections', subject_type='config',
|
||||
subject_id='connections',
|
||||
subject_type='config',
|
||||
data=values,
|
||||
)
|
||||
return values
|
||||
@@ -262,9 +263,7 @@ async def set_tool_servers_config(
|
||||
if auth_type in ('oauth_2.1', 'oauth_2.1_static') and server_id:
|
||||
try:
|
||||
oauth_client_info = resolve_oauth_client_info(connection)
|
||||
oauth_client_info = await recover_static_oauth_client_metadata(
|
||||
connection, oauth_client_info
|
||||
)
|
||||
oauth_client_info = await recover_static_oauth_client_metadata(connection, oauth_client_info)
|
||||
oauth_client_info = apply_connection_oauth_options(connection, oauth_client_info)
|
||||
request.app.state.oauth_client_manager.add_client(
|
||||
f'{server_type}:{server_id}',
|
||||
@@ -278,7 +277,8 @@ async def set_tool_servers_config(
|
||||
request,
|
||||
EVENTS.CONFIG_TOOL_SERVERS_UPDATED,
|
||||
actor=user,
|
||||
subject_id='tool_server.connections', subject_type='config',
|
||||
subject_id='tool_server.connections',
|
||||
subject_type='config',
|
||||
data={'count': len(connections), 'types': [connection.get('type', 'openapi') for connection in connections]},
|
||||
)
|
||||
return {'TOOL_SERVER_CONNECTIONS': connections}
|
||||
@@ -330,7 +330,8 @@ async def set_terminal_servers_config(
|
||||
request,
|
||||
EVENTS.CONFIG_TERMINAL_SERVERS_UPDATED,
|
||||
actor=user,
|
||||
subject_id='terminal_server.connections', subject_type='config',
|
||||
subject_id='terminal_server.connections',
|
||||
subject_type='config',
|
||||
data={'count': len(connections)},
|
||||
)
|
||||
return {'TERMINAL_SERVER_CONNECTIONS': connections}
|
||||
@@ -699,7 +700,8 @@ async def set_code_execution_config(
|
||||
request,
|
||||
EVENTS.CONFIG_CODE_EXECUTION_UPDATED,
|
||||
actor=user,
|
||||
subject_id='code_execution', subject_type='config',
|
||||
subject_id='code_execution',
|
||||
subject_type='config',
|
||||
data={
|
||||
'code_execution_enabled': values.get('ENABLE_CODE_EXECUTION'),
|
||||
'code_execution_engine': values.get('CODE_EXECUTION_ENGINE'),
|
||||
@@ -741,7 +743,8 @@ async def set_models_config(request: Request, form_data: ModelsConfigForm, user=
|
||||
request,
|
||||
EVENTS.CONFIG_MODELS_UPDATED,
|
||||
actor=user,
|
||||
subject_id='models', subject_type='config',
|
||||
subject_id='models',
|
||||
subject_type='config',
|
||||
data={
|
||||
'default_models': values.get('DEFAULT_MODELS'),
|
||||
'default_pinned_models': values.get('DEFAULT_PINNED_MODELS'),
|
||||
@@ -773,7 +776,8 @@ async def set_default_suggestions(
|
||||
request,
|
||||
EVENTS.CONFIG_SUGGESTIONS_UPDATED,
|
||||
actor=user,
|
||||
subject_id='ui.prompt_suggestions', subject_type='config',
|
||||
subject_id='ui.prompt_suggestions',
|
||||
subject_type='config',
|
||||
data={'count': len(suggestions or [])},
|
||||
)
|
||||
return suggestions
|
||||
@@ -801,7 +805,8 @@ async def set_banners(
|
||||
request,
|
||||
EVENTS.CONFIG_BANNERS_UPDATED,
|
||||
actor=user,
|
||||
subject_id='ui.banners', subject_type='config',
|
||||
subject_id='ui.banners',
|
||||
subject_type='config',
|
||||
data={'count': len(banners or [])},
|
||||
)
|
||||
return banners
|
||||
|
||||
Reference in new issue
Block a user