Documentation
¶
Overview ¶
Package usecase 는 AI 어시스턴트의 에이전트 루프다 — 대화를 모델에 넘기고, 모델이 고른 도구를 질문한 사용자의 권한으로 실행해 결과를 되돌려 주며 답을 만든다.
Index ¶
- Constants
- type Chat
- type ChatInput
- type ChatOutput
- type SettingsService
- func (s *SettingsService) Delete(ctx context.Context, orgID string) error
- func (s *SettingsService) Get(ctx context.Context, orgID string) (SettingsView, error)
- func (s *SettingsService) Test(ctx context.Context, orgID string, in UpdateSettings) (TestResult, error)
- func (s *SettingsService) Update(ctx context.Context, orgID, actor string, in UpdateSettings) (SettingsView, error)
- type SettingsView
- type Status
- type TestResult
- type UpdateSettings
Constants ¶
View Source
const DefaultDeadline = 55 * time.Second
DefaultDeadline 은 질문 하나에 쓰는 시간이다. 웹 앞단 프록시(nginx 기본 60초)보다 먼저 끝내야 화면이 504 대신 시간 초과 안내를 받는다.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chat ¶
type Chat struct {
// contains filtered or unexported fields
}
Chat 은 에이전트 루프다. 조직이 관리 화면에서 등록한 설정(공급자 · 모델 · 키)으로 모델을 고른다.
func NewChat ¶
func NewChat(settings port.SettingsRepository, models port.LLMFactory, tools port.ToolSessionOpener) *Chat
type ChatInput ¶
type ChatInput struct {
OrgID string
Turns []domain.Turn
Page domain.PageContext
Credentials port.Credentials
}
ChatInput 은 질문 하나다. Turns 는 화면이 들고 있는 대화 전체(마지막이 이번 질문)다. 모델은 OrgID 의 저장된 설정으로 고른다.
type ChatOutput ¶
ChatOutput 은 답과 그 답을 위해 쓴 도구다.
type SettingsService ¶
type SettingsService struct {
// contains filtered or unexported fields
}
SettingsService 는 조직의 어시스턴트 설정 — 공급자 · 모델 · 키 — 을 관리한다.
func NewSettingsService ¶
func NewSettingsService(repo port.SettingsRepository, models port.LLMFactory) *SettingsService
func (*SettingsService) Delete ¶
func (s *SettingsService) Delete(ctx context.Context, orgID string) error
func (*SettingsService) Get ¶
func (s *SettingsService) Get(ctx context.Context, orgID string) (SettingsView, error)
func (*SettingsService) Test ¶
func (s *SettingsService) Test(ctx context.Context, orgID string, in UpdateSettings) (TestResult, error)
Test 는 보낸 설정(키를 안 보내면 저장된 키)으로 모델에 한 번 물어 본다. 아무것도 저장하지 않는다. 설정이 맞지 않으면 오류, 모델이 실패하면 OK=false 와 사유다 — 사유에서 키는 가린다.
func (*SettingsService) Update ¶
func (s *SettingsService) Update(ctx context.Context, orgID, actor string, in UpdateSettings) (SettingsView, error)
Update 는 설정을 검증해 저장한다.
type SettingsView ¶
type SettingsView struct {
Enabled bool
Provider string
BaseURL string
Model string
HasKey bool
KeyHint string
KeyUnreadable bool
EffectiveBaseURL string
EffectiveModel string
UpdatedAt *time.Time
UpdatedBy string
Providers []domain.Provider
}
SettingsView 는 관리 화면이 보는 설정이다 — 키 원문은 없다.
type TestResult ¶
TestResult 는 연결 테스트 결과다.
Click to show internal directories.
Click to hide internal directories.