Documentation
¶
Index ¶
- type ChatOptions
- type ConversationContext
- type ConversationMessage
- type ConversationRequest
- type ConversationResponse
- type ConversationState
- type DocumentMetadata
- type DocumentSearchRequest
- type DocumentSearchResponse
- type DocumentSearchResult
- type Dql2NlRequest
- type Dql2NlResponse
- type Handler
- func (h *Handler) Chat(text string, state *ConversationState, ctx []ConversationContext) (*ConversationResponse, error)
- func (h *Handler) ChatStream(text string, state *ConversationState, ctx []ConversationContext, ...) (*ConversationResponse, error)
- func (h *Handler) ChatWithOptions(text string, opts ChatOptions, streamCallback func(chunk StreamChunk) error) (*ConversationResponse, error)
- func (h *Handler) DocumentSearch(texts []string, collections []string, exclude []string) (*DocumentSearchResult, error)
- func (h *Handler) Dql2Nl(dql string) (*Dql2NlResponse, error)
- func (h *Handler) ListSkills() (*SkillList, error)
- func (h *Handler) Nl2Dql(text string) (*Nl2DqlResponse, error)
- type Nl2DqlRequest
- type Nl2DqlResponse
- type ScoredDocument
- type Skill
- type SkillList
- type SkillsResponse
- type StreamChunk
- type StreamChunkData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChatOptions ¶
type ChatOptions = sdkcop.ChatOptions
Re-export SDK types that don't need table tags as aliases.
type ConversationContext ¶
type ConversationContext = sdkcop.ConversationContext
Re-export SDK types that don't need table tags as aliases.
type ConversationMessage ¶
type ConversationMessage = sdkcop.ConversationMessage
Re-export SDK types that don't need table tags as aliases.
type ConversationRequest ¶
type ConversationRequest = sdkcop.ConversationRequest
Re-export SDK types that don't need table tags as aliases.
type ConversationResponse ¶
type ConversationResponse struct {
Text string `json:"text" table:"RESPONSE"`
State *ConversationState `json:"state,omitempty" table:"-"`
}
ConversationResponse represents a response from the CoPilot conversation endpoint.
type ConversationState ¶
type ConversationState = sdkcop.ConversationState
Re-export SDK types that don't need table tags as aliases.
type DocumentMetadata ¶
type DocumentMetadata = sdkcop.DocumentMetadata
Re-export SDK types that don't need table tags as aliases.
type DocumentSearchRequest ¶
type DocumentSearchRequest = sdkcop.DocumentSearchRequest
Re-export SDK types that don't need table tags as aliases.
type DocumentSearchResponse ¶
type DocumentSearchResponse struct {
MessageToken string `json:"messageToken"`
Results []ScoredDocument `json:"results"`
Status string `json:"status"`
}
DocumentSearchResponse represents the response from document search. Used for JSON deserialization in tests.
type DocumentSearchResult ¶
type DocumentSearchResult struct {
Documents []ScoredDocument
Status string
}
DocumentSearchResult is a processed result for display.
type Dql2NlRequest ¶
type Dql2NlRequest = sdkcop.Dql2NlRequest
Re-export SDK types that don't need table tags as aliases.
type Dql2NlResponse ¶
type Dql2NlResponse struct {
Summary string `json:"summary" table:"SUMMARY"`
Explanation string `json:"explanation" table:"EXPLANATION"`
MessageToken string `json:"messageToken" table:"-"`
Status string `json:"status" table:"STATUS"`
}
Dql2NlResponse represents the response from the DQL to NL skill.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler handles Davis CoPilot resources.
func NewHandler ¶
NewHandler creates a new copilot handler
func (*Handler) Chat ¶
func (h *Handler) Chat(text string, state *ConversationState, ctx []ConversationContext) (*ConversationResponse, error)
Chat sends a message to CoPilot and returns the response
func (*Handler) ChatStream ¶
func (h *Handler) ChatStream(text string, state *ConversationState, ctx []ConversationContext, callback func(chunk StreamChunk) error) (*ConversationResponse, error)
ChatStream sends a message to CoPilot and streams the response
func (*Handler) ChatWithOptions ¶
func (h *Handler) ChatWithOptions(text string, opts ChatOptions, streamCallback func(chunk StreamChunk) error) (*ConversationResponse, error)
ChatWithOptions sends a message with options
func (*Handler) DocumentSearch ¶
func (h *Handler) DocumentSearch(texts []string, collections []string, exclude []string) (*DocumentSearchResult, error)
DocumentSearch searches for relevant documents
func (*Handler) Dql2Nl ¶
func (h *Handler) Dql2Nl(dql string) (*Dql2NlResponse, error)
Dql2Nl explains a DQL query in natural language
func (*Handler) ListSkills ¶
ListSkills retrieves all available CoPilot skills
type Nl2DqlRequest ¶
type Nl2DqlRequest = sdkcop.Nl2DqlRequest
Re-export SDK types that don't need table tags as aliases.
type Nl2DqlResponse ¶
type Nl2DqlResponse struct {
DQL string `json:"dql" table:"DQL"`
MessageToken string `json:"messageToken" table:"-"`
Status string `json:"status" table:"STATUS"`
}
Nl2DqlResponse represents the response from the NL to DQL skill.
type ScoredDocument ¶
type ScoredDocument struct {
DocumentID string `json:"documentId" table:"ID"`
RelevanceScore float64 `json:"relevanceScore" table:"SCORE"`
DocumentMetadata DocumentMetadata `json:"documentMetadata" table:"-"`
Name string `table:"NAME"`
Type string `table:"TYPE"`
}
ScoredDocument represents a document with its relevance score.
type Skill ¶
type Skill struct {
Name string `table:"NAME"`
}
Skill represents an available CoPilot skill with CLI display fields.
type SkillList ¶
type SkillList struct {
Skills []Skill
}
SkillList is the processed list for display.
type SkillsResponse ¶
type SkillsResponse = sdkcop.SkillsResponse
Re-export SDK types that don't need table tags as aliases.
type StreamChunk ¶
type StreamChunk = sdkcop.StreamChunk
Re-export SDK types that don't need table tags as aliases.
type StreamChunkData ¶
type StreamChunkData = sdkcop.StreamChunkData
Re-export SDK types that don't need table tags as aliases.