"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from .basesdk import BaseSDK, SyncSDK, AsyncSDK
from .sdkconfiguration import SDKConfiguration
from friendli.core.knowledge import SyncKnowledge, AsyncKnowledge
from friendli.core.model import SyncModel, AsyncModel
from friendli.core.serverless_chat import SyncServerlessChat, AsyncServerlessChat
from friendli.core.serverless_chatrender import (
    SyncServerlessChatRender,
    AsyncServerlessChatRender,
)
from friendli.core.serverless_completions import (
    SyncServerlessCompletions,
    AsyncServerlessCompletions,
)
from friendli.core.serverless_token import SyncServerlessToken, AsyncServerlessToken
from friendli.core.toolassistedchat import SyncToolAssistedChat, AsyncToolAssistedChat
from typing import Optional
import abc


class BaseServerless(BaseSDK):
    def __init__(
        self, sdk_config: SDKConfiguration, parent_ref: Optional[object] = None
    ) -> None:
        BaseSDK.__init__(self, sdk_config, parent_ref=parent_ref)
        self.sdk_configuration = sdk_config
        self._init_sdks()

    def _init_sdks(self) -> None: ...


class SyncServerless(BaseServerless, SyncSDK):
    chat: SyncServerlessChat
    chat_render: SyncServerlessChatRender
    completions: SyncServerlessCompletions
    token: SyncServerlessToken
    tool_assisted_chat: SyncToolAssistedChat
    knowledge: SyncKnowledge
    model: SyncModel

    def _init_sdks(self):
        self.chat = SyncServerlessChat(
            self.sdk_configuration, parent_ref=self.parent_ref
        )
        self.chat_render = SyncServerlessChatRender(
            self.sdk_configuration, parent_ref=self.parent_ref
        )
        self.completions = SyncServerlessCompletions(
            self.sdk_configuration, parent_ref=self.parent_ref
        )
        self.token = SyncServerlessToken(
            self.sdk_configuration, parent_ref=self.parent_ref
        )
        self.tool_assisted_chat = SyncToolAssistedChat(
            self.sdk_configuration, parent_ref=self.parent_ref
        )
        self.knowledge = SyncKnowledge(
            self.sdk_configuration, parent_ref=self.parent_ref
        )
        self.model = SyncModel(self.sdk_configuration, parent_ref=self.parent_ref)


class AsyncServerless(BaseServerless, AsyncSDK):
    chat: AsyncServerlessChat
    chat_render: AsyncServerlessChatRender
    completions: AsyncServerlessCompletions
    token: AsyncServerlessToken
    tool_assisted_chat: AsyncToolAssistedChat
    knowledge: AsyncKnowledge
    model: AsyncModel

    def _init_sdks(self):
        self.chat = AsyncServerlessChat(
            self.sdk_configuration, parent_ref=self.parent_ref
        )
        self.chat_render = AsyncServerlessChatRender(
            self.sdk_configuration, parent_ref=self.parent_ref
        )
        self.completions = AsyncServerlessCompletions(
            self.sdk_configuration, parent_ref=self.parent_ref
        )
        self.token = AsyncServerlessToken(
            self.sdk_configuration, parent_ref=self.parent_ref
        )
        self.tool_assisted_chat = AsyncToolAssistedChat(
            self.sdk_configuration, parent_ref=self.parent_ref
        )
        self.knowledge = AsyncKnowledge(
            self.sdk_configuration, parent_ref=self.parent_ref
        )
        self.model = AsyncModel(self.sdk_configuration, parent_ref=self.parent_ref)
