from abc import ABC
from HowdenLLM.providers.base_provider import BaseProvider
from anthropic import Anthropic
from .known_providers import KnownProviders

class AnthropicProvider(BaseProvider, ABC):
    provider = KnownProviders.Anthropic

    def __init__(self,client: Anthropic):
        self.client = client

    def complete(self, system: str, prompt: str, model: str, use_web_search_tool: bool) -> str:
        if model in ["claude-opus-4-6","claude-sonnet-4-6"]:
            message = self.client.messages.create(
                model=model,
                system=system,
                messages=[
                    {"role": "user","content": prompt}
                ],
                max_tokens=16000,
                temperature=0.0

            )
        else:
            raise Exception(f"Unsupported model: {model}")

        return message.content[0].text
