12345678910111213141516171819202122232425 |
- package llm
- import (
- "net/http"
- "time"
- )
- type LLMClient struct {
- BaseURL string
- HttpClient *http.Client
- }
- func NewLLMClient(baseURL string, timeout time.Duration) *LLMClient {
- return &LLMClient{
- BaseURL: baseURL,
- HttpClient: &http.Client{
- Timeout: timeout * time.Second,
- },
- }
- }
- type LLMService interface {
- KnowledgeBaseChat(query string, KnowledgeBaseName string, history []string) (llmRes *http.Response, err error)
- SearchKbDocs(query string, KnowledgeBaseName string) (data interface{}, err error)
- }
|