llm.go 356 B

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