Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 0 additions & 44 deletions .github/workflows/update-pre-commit.yml

This file was deleted.

8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,19 @@ repos:
- id: pyupgrade

- repo: https://github.com/psf/black
rev: 23.9.1
rev: 25.9.0
hooks:
- id: black
args: [ --skip-string-normalization, --line-length=88 ]

- repo: https://github.com/pycqa/isort
rev: 5.12.0
rev: 6.0.1
hooks:
- id: isort
args: [ "--profile", "black" ]

- repo: https://github.com/pycqa/autoflake
rev: v2.2.1
rev: v2.3.1
hooks:
- id: autoflake
args:
Expand All @@ -84,7 +84,7 @@ repos:
- --remove-unused-variables

- repo: https://github.com/pycqa/flake8
rev: 6.1.0
rev: 7.3.0
hooks:
- id: flake8
additional_dependencies: [ flake8-bugbear ]
Expand Down
6 changes: 3 additions & 3 deletions agents/matmaster_agent/base_agents/job_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -870,9 +870,9 @@ async def _run_async_impl(

if not params_check_completed:
# Call ParamsCheckInfoAgent to generate params needing check
async for params_check_info_event in self.params_check_info_agent.run_async(
ctx
):
async for (
params_check_info_event
) in self.params_check_info_agent.run_async(ctx):
yield params_check_info_event
else:
async for submit_event in self.submit_agent.run_async(ctx):
Expand Down
6 changes: 3 additions & 3 deletions agents/matmaster_agent/callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,9 @@ async def matmaster_check_job_status(
llm_response.content = None
break
if not reset:
callback_context.state[
'special_llm_response'
] = True # 标记开始处理原来消息的非流式版本
callback_context.state['special_llm_response'] = (
True # 标记开始处理原来消息的非流式版本
)
llm_response.content.parts = []
reset = True
function_call_id = f"call_{str(uuid.uuid4()).replace('-', '')[:24]}"
Expand Down
4 changes: 3 additions & 1 deletion agents/matmaster_agent/chembrain_agent/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@ async def _run_async_impl(
and event.content.parts
and event.content.parts[0].function_response
):
logger.info(f"{event.content.parts[0].function_response.name} 调用结束")
logger.info(
f"{event.content.parts[0].function_response.name} 调用结束"
)
yield Event(
author=self.name,
actions=EventActions(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ async def smiles_conversion_after_tool(
'after': {
'tool_name': tool.name,
'tool_args': args,
'tool_response': tool_response.content[0].text
if (tool_response and len(tool_response.content))
else None,
'tool_response': (
tool_response.content[0].text
if (tool_response and len(tool_response.content))
else None
),
}
}

Expand Down
4 changes: 3 additions & 1 deletion agents/matmaster_agent/ssebrain_agent/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@ async def _run_async_impl(
and event.content.parts
and event.content.parts[0].function_response
):
logger.info(f"{event.content.parts[0].function_response.name} 调用结束")
logger.info(
f"{event.content.parts[0].function_response.name} 调用结束"
)
yield Event(
author=self.name,
actions=EventActions(
Expand Down
4 changes: 3 additions & 1 deletion agents/matmaster_agent/ssebrain_agent/callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ async def ssebrain_before_agent(
callback_context.state['current_time'] = datetime.now().strftime(
'%Y-%m-%d %H:%M:%S'
)
callback_context.state['db_name'] = 'solid_state_electrolyte_db' # 使用默认数据库
callback_context.state['db_name'] = (
'solid_state_electrolyte_db' # 使用默认数据库
)
db_manager = DatabaseManager('solid_state_electrolyte_db')
await db_manager.async_init() # Call the async init method
callback_context.state['available_tables'] = db_manager.table_schema
Expand Down
8 changes: 6 additions & 2 deletions agents/matmaster_agent/utils/helper_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ async def update_session_state(ctx: InvocationContext, author: str):
author=f"{filename}:{lineno}",
actions=actions_with_update,
)
await ctx.session_service.append_event(ctx.session, system_event) # 会引入一个空消息
await ctx.session_service.append_event(
ctx.session, system_event
) # 会引入一个空消息


def update_llm_response(
Expand Down Expand Up @@ -339,7 +341,9 @@ def get_new_function_call_indices(

def check_None_wrapper(func):
def wrapper(*args, **kwargs):
result = func(*args, **kwargs) # 注意这里应该是 *args, **kwargs 而不是 args, kwargs
result = func(
*args, **kwargs
) # 注意这里应该是 *args, **kwargs 而不是 args, kwargs
if result is None:
raise ValueError(
f"'{func.__name__.replace('_get_', '')}' was not found, please provide it!"
Expand Down
10 changes: 6 additions & 4 deletions evaluate/base/human_simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ def _generate_user_response(self, agent_message: str) -> Tuple[str, bool]:
user_response = result.get('response', '我理解了。')
should_continue = result.get('continue', True)

logger.info(f"用户响应生成 - 轮次: {self.turn_count}, 继续: {should_continue}")
logger.info(
f"用户响应生成 - 轮次: {self.turn_count}, 继续: {should_continue}"
)

return user_response, should_continue

Expand Down Expand Up @@ -199,9 +201,9 @@ def get_conversation_summary(self) -> Dict[str, Any]:
'goal': self.goal.initial_question if self.goal else None,
'total_turns': self.turn_count,
'final_state': self.current_state.value,
'duration_minutes': ((time.time() - self.start_time) / 60)
if self.start_time
else 0,
'duration_minutes': (
((time.time() - self.start_time) / 60) if self.start_time else 0
),
'conversation_history': self.conversation_history,
}

Expand Down
Loading