| |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| """ |
| Kiro Gateway - Proxy for Kiro API. |
| |
| This package provides a modular architecture for proxying |
| OpenAI API requests to Kiro (AWS CodeWhisperer). |
| |
| Modules: |
| - config: Configuration and constants |
| - models: Pydantic models for OpenAI API |
| - auth: Kiro authentication manager |
| - cache: Model metadata cache |
| - utils: Helper utilities |
| - converters: OpenAI <-> Kiro format conversion |
| - parsers: AWS SSE stream parsers |
| - streaming: Response streaming logic |
| - http_client: HTTP client with retry logic |
| - routes: FastAPI routes |
| - exceptions: Exception handlers |
| """ |
|
|
| |
| |
| from kiro.config import APP_VERSION as __version__ |
|
|
| __author__ = "Jwadow" |
|
|
| |
| from kiro.auth import KiroAuthManager |
| from kiro.cache import ModelInfoCache |
| from kiro.http_client import KiroHttpClient |
| from kiro.routes_openai import router |
| from kiro.model_resolver import ModelResolver, normalize_model_name, get_model_id_for_kiro |
|
|
| |
| from kiro.config import ( |
| PROXY_API_KEY, |
| REGION, |
| HIDDEN_MODELS, |
| APP_VERSION, |
| ) |
|
|
| |
| from kiro.models_openai import ( |
| ChatCompletionRequest, |
| ChatMessage, |
| OpenAIModel, |
| ModelList, |
| ) |
|
|
| |
| from kiro.converters_openai import build_kiro_payload |
| from kiro.converters_core import ( |
| extract_text_content, |
| merge_adjacent_messages, |
| ) |
|
|
| |
| from kiro.parsers import ( |
| AwsEventStreamParser, |
| parse_bracket_tool_calls, |
| ) |
|
|
| |
| from kiro.streaming_openai import ( |
| stream_kiro_to_openai, |
| collect_stream_response, |
| ) |
|
|
| |
| from kiro.exceptions import ( |
| validation_exception_handler, |
| sanitize_validation_errors, |
| ) |
|
|
| __all__ = [ |
| |
| "__version__", |
| |
| |
| "KiroAuthManager", |
| "ModelInfoCache", |
| "KiroHttpClient", |
| "ModelResolver", |
| "router", |
| |
| |
| "PROXY_API_KEY", |
| "REGION", |
| "HIDDEN_MODELS", |
| "APP_VERSION", |
| |
| |
| "normalize_model_name", |
| "get_model_id_for_kiro", |
| |
| |
| "ChatCompletionRequest", |
| "ChatMessage", |
| "OpenAIModel", |
| "ModelList", |
| |
| |
| "build_kiro_payload", |
| "extract_text_content", |
| "merge_adjacent_messages", |
| |
| |
| "AwsEventStreamParser", |
| "parse_bracket_tool_calls", |
| |
| |
| "stream_kiro_to_openai", |
| "collect_stream_response", |
| |
| |
| "validation_exception_handler", |
| "sanitize_validation_errors", |
| ] |