llm.go 378 B

12345678910111213141516171819
  1. package llm
  2. import (
  3. "context"
  4. )
  5. type Chat interface {
  6. Ask(ctx context.Context, text string) (string, error)
  7. WithUserContext(user *UserContext) Chat
  8. Close(ctx context.Context) error
  9. }
  10. type AI interface {
  11. UserBrowserAgent
  12. Init(ctx context.Context, debug bool) (AI, error)
  13. NewChat(ctx context.Context) (Chat, error)
  14. Close(ctx context.Context) error
  15. GetName() string
  16. }