Spaces:
Running
Running
Download github_rag/llm/base.py from akadirgok/github-asistani: direct link, hf CLI and curl.
- Browser
- Download file 642 Bytes
-
https://huggingface.co/spaces/akadirgok/github-asistani/resolve/main/github_rag/llm/base.py
- Command line
-
hf download hf://spaces/akadirgok/github-asistani/github_rag/llm/base.py
-
curl -L -o base.py https://huggingface.co/spaces/akadirgok/github-asistani/resolve/main/github_rag/llm/base.py
642 Bytes
| # -*- coding: utf-8 -*- | |
| """LLM arka ucu arayüzü. | |
| generate_answer yalnızca bu arayüzü bilir; böylece farklı arka uçlar | |
| (DeepSeek, Groq vb.) birbirinin yerine takılabilir olur. | |
| """ | |
| from abc import ABC, abstractmethod | |
| class LLMBackend(ABC): | |
| """Mesaj listesinden metin cevabı üreten herhangi bir model arka ucu.""" | |
| def complete(self, messages: list[dict], max_tokens: int, | |
| temperature: float, repeat_penalty: float = 1.1, | |
| top_p: float = 0.9) -> str: | |
| """messages: [{"role": "system"/"user", "content": ...}] -> cevap metni.""" | |
| raise NotImplementedError | |