chore: fix all ruff lint errors + format — 0 errors, 306 tests pass
This commit is contained in:
+22
-6
@@ -7,9 +7,9 @@ tests to run without external API dependencies.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
from typing import Any
|
||||
|
||||
import httpx
|
||||
@@ -20,7 +20,9 @@ logger = logging.getLogger(__name__)
|
||||
class LLMResponse:
|
||||
"""Structured LLM response containing proposed actions."""
|
||||
|
||||
def __init__(self, message: str, proposed_actions: list[dict[str, Any]], confidence: float = 0.8):
|
||||
def __init__(
|
||||
self, message: str, proposed_actions: list[dict[str, Any]], confidence: float = 0.8
|
||||
):
|
||||
self.message = message
|
||||
self.proposed_actions = proposed_actions
|
||||
self.confidence = confidence
|
||||
@@ -41,7 +43,9 @@ class LLMClient:
|
||||
- Otherwise: mock/stub mode with keyword-based action mapping
|
||||
"""
|
||||
|
||||
def __init__(self, model: str | None = None, api_key: str | None = None, api_base: str | None = None):
|
||||
def __init__(
|
||||
self, model: str | None = None, api_key: str | None = None, api_base: str | None = None
|
||||
):
|
||||
self.model = model or os.environ.get("AI_MODEL", "")
|
||||
self.api_key = api_key or os.environ.get("AI_API_KEY", "")
|
||||
self.api_base = api_base or os.environ.get("AI_API_BASE", "https://api.openai.com/v1")
|
||||
@@ -118,9 +122,21 @@ class LLMClient:
|
||||
available_apis = [
|
||||
{"method": "GET", "path": "/api/v1/companies", "description": "List companies"},
|
||||
{"method": "POST", "path": "/api/v1/companies", "description": "Create a company"},
|
||||
{"method": "GET", "path": "/api/v1/companies/{id}", "description": "Get company details"},
|
||||
{"method": "PATCH", "path": "/api/v1/companies/{id}", "description": "Update a company"},
|
||||
{"method": "DELETE", "path": "/api/v1/companies/{id}", "description": "Delete a company"},
|
||||
{
|
||||
"method": "GET",
|
||||
"path": "/api/v1/companies/{id}",
|
||||
"description": "Get company details",
|
||||
},
|
||||
{
|
||||
"method": "PATCH",
|
||||
"path": "/api/v1/companies/{id}",
|
||||
"description": "Update a company",
|
||||
},
|
||||
{
|
||||
"method": "DELETE",
|
||||
"path": "/api/v1/companies/{id}",
|
||||
"description": "Delete a company",
|
||||
},
|
||||
{"method": "GET", "path": "/api/v1/contacts", "description": "List contacts"},
|
||||
{"method": "POST", "path": "/api/v1/contacts", "description": "Create a contact"},
|
||||
{"method": "GET", "path": "/api/v1/workflows", "description": "List workflows"},
|
||||
|
||||
Reference in New Issue
Block a user