from HowdenLLM.providers.base_provider import BaseProvider
from dotenv import load_dotenv
import os
from huggingface_hub import InferenceClient
from .known_providers import KnownProviders


class HuggingFaceProvider(BaseProvider):
    provider = KnownProviders.HuggingFace

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

    def complete(self, system: str, prompt: str, model: str, use_web_search_tool: bool) -> str:
        full_prompt = f"[System]: {system}\n[User]: {prompt}\n"
        response = self.client.text_generation(
            model=model,
            prompt=full_prompt,
            max_new_tokens=500,
            temperature=0.0,
        )
        return response