* Add tools for creating, retrieving, updating, and deleting thoughts. * Implement project management tools for creating and listing projects. * Introduce linking functionality between thoughts. * Add search and recall capabilities for thoughts based on semantic queries. * Implement statistics and summarization tools for thought analysis. * Create database migrations for thoughts, projects, and links. * Add helper functions for UUID parsing and project resolution.
23 lines
534 B
Go
23 lines
534 B
Go
package ai
|
|
|
|
import (
|
|
"fmt"
|
|
"log/slog"
|
|
"net/http"
|
|
|
|
"git.warky.dev/wdevs/amcs/internal/ai/litellm"
|
|
"git.warky.dev/wdevs/amcs/internal/ai/openrouter"
|
|
"git.warky.dev/wdevs/amcs/internal/config"
|
|
)
|
|
|
|
func NewProvider(cfg config.AIConfig, httpClient *http.Client, log *slog.Logger) (Provider, error) {
|
|
switch cfg.Provider {
|
|
case "litellm":
|
|
return litellm.New(cfg, httpClient, log)
|
|
case "openrouter":
|
|
return openrouter.New(cfg, httpClient, log)
|
|
default:
|
|
return nil, fmt.Errorf("unsupported ai.provider: %s", cfg.Provider)
|
|
}
|
|
}
|