Commit d1079827 authored by Your Name's avatar Your Name

Start refactoring

parent 61ecc606
......@@ -43,6 +43,8 @@ from .providers import (
get_provider_handler,
PROVIDER_HANDLERS
)
from .providers.kiro import KiroProviderHandler
from .auth.kiro import KiroAuthManager
from .handlers import RequestHandler, RotationHandler, AutoselectHandler
from .utils import count_messages_tokens, split_messages_into_chunks, get_max_request_tokens_for_model
......@@ -71,8 +73,11 @@ __all__ = [
"OpenAIProviderHandler",
"AnthropicProviderHandler",
"OllamaProviderHandler",
"KiroProviderHandler",
"get_provider_handler",
"PROVIDER_HANDLERS",
# Auth
"KiroAuthManager",
# Handlers
"RequestHandler",
"RotationHandler",
......
"""
Copyleft (C) 2026 Stefy Lanza <stefy@nexlab.net>
AISBF - AI Service Broker Framework || AI Should Be Free
Authentication modules for AISBF providers.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Why did the programmer quit his job? Because he didn't get arrays!
"""
from .kiro import KiroAuthManager, AuthType
__all__ = [
"KiroAuthManager",
"AuthType",
]
"""
Copyleft (C) 2026 Stefy Lanza <stefy@nexlab.net>
AISBF - AI Service Broker Framework || AI Should Be Free
Kiro provider package - Direct Kiro API integration (Amazon Q Developer).
This package contains:
- handler: KiroProviderHandler for API requests
- converters: Core format converters (OpenAI/Anthropic → Kiro)
- converters_openai: OpenAI-specific adapter layer
- models: Data models for Kiro converters
- parsers: AWS Event Stream parser
- utils: Utility functions
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Why did the programmer quit his job? Because he didn't get arrays!
"""
from .handler import KiroProviderHandler
__all__ = [
"KiroProviderHandler",
]
......@@ -37,7 +37,7 @@ from typing import Any, Dict, List, Optional, Tuple
logger = logging.getLogger(__name__)
# Import Kiro models for type hints
from .kiro_models import ChatMessage, Tool
from .models import ChatMessage, Tool
# Hidden models - not returned by Kiro /ListAvailableModels API but still functional.
# These need special internal IDs that differ from their display names.
......@@ -147,7 +147,7 @@ def get_model_id_for_kiro(model: str, hidden_models: dict) -> str:
return hidden_models.get(normalized, normalized)
# Import from core - reuse shared logic
from .kiro_converters import (
from .converters import (
extract_text_content,
extract_images_from_content,
UnifiedMessage,
......@@ -431,7 +431,7 @@ def build_kiro_payload_from_dict(
Raises:
ValueError: If there are no messages to send
"""
from .kiro_models import create_chat_completion_request
from .models import create_chat_completion_request
# Convert dicts to dataclasses
request_data = create_chat_completion_request(
......
This diff is collapsed.
......@@ -48,7 +48,7 @@ Documentation = "https://git.nexlab.net/nexlab/aisbf.git"
"Bug Tracker" = "https://git.nexlab.net/nexlab/aisbf.git/issues"
[tool.setuptools]
packages = ["aisbf"]
packages = ["aisbf", "aisbf.auth", "aisbf.providers", "aisbf.providers.kiro"]
py-modules = ["cli"]
[tool.setuptools.package-data]
......
......@@ -98,19 +98,22 @@ setup(
'aisbf/__init__.py',
'aisbf/config.py',
'aisbf/models.py',
'aisbf/providers.py',
'aisbf/providers/__init__.py',
'aisbf/handlers.py',
'aisbf/context.py',
'aisbf/utils.py',
'aisbf/database.py',
'aisbf/mcp.py',
'aisbf/tor.py',
'aisbf/kiro_auth.py',
'aisbf/kiro_converters.py',
'aisbf/kiro_converters_openai.py',
'aisbf/kiro_models.py',
'aisbf/kiro_parsers.py',
'aisbf/kiro_utils.py',
'aisbf/auth/__init__.py',
'aisbf/auth/kiro.py',
'aisbf/providers/kiro/__init__.py',
'aisbf/providers/kiro/handler.py',
'aisbf/providers/kiro/converters.py',
'aisbf/providers/kiro/converters_openai.py',
'aisbf/providers/kiro/models.py',
'aisbf/providers/kiro/parsers.py',
'aisbf/providers/kiro/utils.py',
'aisbf/claude_auth.py',
'aisbf/semantic_classifier.py',
'aisbf/batching.py',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment