diff --git a/cli/utils.py b/cli/utils.py index 95494a5a..7607c25e 100644 --- a/cli/utils.py +++ b/cli/utils.py @@ -377,7 +377,7 @@ def perform_copilot_oauth() -> bool: """ from tradingagents.llm_clients.copilot_client import check_copilot_auth, get_github_token - token = _get_github_token() + token = get_github_token() if token: if check_copilot_auth(): console.print("[green]✓ Authenticated with GitHub Copilot[/green]") diff --git a/tradingagents/llm_clients/copilot_client.py b/tradingagents/llm_clients/copilot_client.py index 8d2005be..fb9db988 100644 --- a/tradingagents/llm_clients/copilot_client.py +++ b/tradingagents/llm_clients/copilot_client.py @@ -37,7 +37,7 @@ _PASSTHROUGH_KWARGS = ( ) -def _get_github_token() -> Optional[str]: +def get_github_token() -> Optional[str]: """Return a GitHub token via the ``gh`` CLI.""" try: result = subprocess.run( @@ -54,7 +54,7 @@ def _get_github_token() -> Optional[str]: def _get_copilot_api_url() -> str: """Resolve the Copilot inference base URL via GraphQL, falling back to the standard individual endpoint.""" - token = _get_github_token() + token = get_github_token() if token: try: resp = requests.post( @@ -78,7 +78,7 @@ def list_copilot_models() -> list[tuple[str, str]]: Returns a list of ``(display_label, model_id)`` tuples sorted by model ID. Requires ``gh auth login`` with an active Copilot subscription. """ - token = _get_github_token() + token = get_github_token() if not token: return [] try: @@ -99,7 +99,7 @@ def list_copilot_models() -> list[tuple[str, str]]: def check_copilot_auth() -> bool: """Return True if a GitHub token with Copilot access is available.""" - token = _get_github_token() + token = get_github_token() if not token: return False try: @@ -131,7 +131,7 @@ class CopilotClient(BaseLLMClient): def get_llm(self) -> Any: """Return configured ChatOpenAI instance pointed at the Copilot API.""" - token = _get_github_token() + token = get_github_token() if not token: raise RuntimeError( "No GitHub token found. Run `gh auth login` to authenticate."