Skip to content
Closed
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
4 changes: 2 additions & 2 deletions agent/conversation_loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import threading
import time
import uuid
from typing import Any, Dict, List, Optional
from typing import Any, Callable, Dict, List, Optional

from agent.codex_responses_adapter import _summarize_user_message_for_log
from agent.display import KawaiiSpinner
Expand Down Expand Up @@ -498,7 +498,7 @@ def run_conversation(
system_message: str = None,
conversation_history: List[Dict[str, Any]] = None,
task_id: str = None,
stream_callback: Optional[callable] = None,
stream_callback: Optional[Callable[[Optional[str]], None]] = None,
persist_user_message: Optional[str] = None,
persist_user_timestamp: Optional[float] = None,
) -> Dict[str, Any]:
Expand Down
2 changes: 1 addition & 1 deletion gateway/stream_consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def __init__(
chat_id: str,
config: Optional[StreamConsumerConfig] = None,
metadata: Optional[dict] = None,
on_new_message: Optional[callable] = None,
on_new_message: Optional[Callable[[], None]] = None,
initial_reply_to_id: Optional[str] = None,
):
self.adapter = adapter
Expand Down
4 changes: 2 additions & 2 deletions hermes_cli/dingtalk_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import sys
import time
import logging
from typing import Optional, Tuple
from typing import Callable, Optional, Tuple

import requests

Expand Down Expand Up @@ -107,7 +107,7 @@ def wait_for_registration_success(
device_code: str,
interval: int = 3,
expires_in: int = 7200,
on_waiting: Optional[callable] = None,
on_waiting: Optional[Callable[[], None]] = None,
) -> Tuple[str, str]:
"""Block until the registration succeeds or times out.

Expand Down
4 changes: 2 additions & 2 deletions plugins/disk-cleanup/disk_cleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import shutil
from datetime import datetime, timezone
from pathlib import Path
from typing import Any, Dict, List, Optional, Tuple
from typing import Any, Callable, Dict, List, Optional, Tuple

try:
from hermes_constants import get_hermes_home
Expand Down Expand Up @@ -420,7 +420,7 @@ def quick() -> Dict[str, Any]:
# ---------------------------------------------------------------------------

def deep(
confirm: Optional[callable] = None,
confirm: Optional[Callable[[Dict[str, Any]], bool]] = None,
) -> Dict[str, Any]:
"""Deep cleanup.

Expand Down
4 changes: 2 additions & 2 deletions run_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -5287,7 +5287,7 @@ def run_conversation(
system_message: str = None,
conversation_history: List[Dict[str, Any]] = None,
task_id: str = None,
stream_callback: Optional[callable] = None,
stream_callback: Optional[Callable[[Optional[str]], None]] = None,
persist_user_message: Optional[str] = None,
persist_user_timestamp: Optional[float] = None,
) -> Dict[str, Any]:
Expand All @@ -5304,7 +5304,7 @@ def run_conversation(
persist_user_timestamp,
)

def chat(self, message: str, stream_callback: Optional[callable] = None) -> str:
def chat(self, message: str, stream_callback: Optional[Callable[[Optional[str]], None]] = None) -> str:
"""
Simple chat interface that returns just the final response.

Expand Down
4 changes: 2 additions & 2 deletions tools/delegate_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
ThreadPoolExecutor,
TimeoutError as FuturesTimeoutError,
)
from typing import Any, Dict, List, Optional
from typing import Any, Callable, Dict, List, Optional

from toolsets import TOOLSETS

Expand Down Expand Up @@ -779,7 +779,7 @@ def _build_child_progress_callback(
model: Optional[str] = None,
toolsets: Optional[List[str]] = None,
session_ref: Optional[Dict[str, Any]] = None,
) -> Optional[callable]:
) -> Optional[Callable[..., None]]:
"""Build a callback that relays child agent tool calls to the parent display.

Two display paths:
Expand Down
Loading