Documentation
¶
Index ¶
- Constants
- func BuildTestPlanPrompt(what, focus string) string
- type APIEndpoint
- type Agent
- func (a *Agent) Chat(messages []ChatMessage, thinkingEnabled bool, endpointsList ...string) (*ChatResponse, error)
- func (a *Agent) ChatStream(messages []ChatMessage, thinkingEnabled bool, callback ReasoningCallback, ...) (*ChatResponse, error)
- func (a *Agent) GenerateTestPlan(what, focus string) ([]Test, int64, error)
- func (a *Agent) ProcessSpecification(rawContent string, baseURL string) ([]APIEndpoint, error)
- func (a *Agent) ProcessSpecificationIterative(rawContent string, baseURL string, messages []ChatMessage, ...) (*ProcessSpecResult, error)
- type BaseAgent
- type ChatMessage
- type ChatResponse
- type FunctionResponseData
- type ProcessSpecResult
- type ReasoningCallback
- type Test
- type TestCase
- type TestPlan
- type TestStatus
- type ToolCall
Constants ¶
View Source
const ( // Spec processing constants SpecPreviewLines = 30 // Number of lines to show in spec preview MaxIterations = 10 // Maximum iterations for spec processing )
Variables ¶
This section is empty.
Functions ¶
func BuildTestPlanPrompt ¶
BuildTestPlanPrompt generates tests based on detailed endpoint description The main agent uses SearchSpec to gather full endpoint details and passes them in 'what'
Types ¶
type APIEndpoint ¶
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
func (*Agent) Chat ¶
func (a *Agent) Chat(messages []ChatMessage, thinkingEnabled bool, endpointsList ...string) (*ChatResponse, error)
func (*Agent) ChatStream ¶
func (a *Agent) ChatStream(messages []ChatMessage, thinkingEnabled bool, callback ReasoningCallback, endpointsList ...string) (*ChatResponse, error)
func (*Agent) GenerateTestPlan ¶
func (*Agent) ProcessSpecification ¶
func (a *Agent) ProcessSpecification(rawContent string, baseURL string) ([]APIEndpoint, error)
func (*Agent) ProcessSpecificationIterative ¶
func (a *Agent) ProcessSpecificationIterative(rawContent string, baseURL string, messages []ChatMessage, toolResults []map[string]interface{}) (*ProcessSpecResult, error)
type BaseAgent ¶
type BaseAgent struct {
// contains filtered or unexported fields
}
func NewBaseAgent ¶
func (*BaseAgent) Chat ¶
func (a *BaseAgent) Chat(systemPrompt string, tools []common.Tool, inputMessages []ChatMessage, thinkingEnabled bool) (*ChatResponse, error)
func (*BaseAgent) ChatStream ¶
func (a *BaseAgent) ChatStream(systemPrompt string, tools []common.Tool, inputMessages []ChatMessage, thinkingEnabled bool, callback ReasoningCallback) (*ChatResponse, error)
type ChatMessage ¶
type ChatMessage struct {
Role string `json:"role"`
Content string `json:"content"`
ReasoningContent string `json:"reasoning_content,omitempty"`
FunctionCalls []ToolCall `json:"function_calls,omitempty"`
FunctionResponse *FunctionResponseData `json:"function_response,omitempty"`
InputTokens int64 `json:"input_tokens,omitempty"`
OutputTokens int64 `json:"output_tokens,omitempty"`
}
type ChatResponse ¶
type ChatResponse struct {
Message string `json:"message"`
Reasoning string `json:"reasoning,omitempty"`
ToolCalls []ToolCall `json:"tool_calls,omitempty"`
TokensUsed int64 `json:"tokens_used,omitempty"` // Total tokens (input + output)
InputTokens int64 `json:"input_tokens,omitempty"` // Input tokens used
OutputTokens int64 `json:"output_tokens,omitempty"` // Output tokens used
}
type FunctionResponseData ¶
type ProcessSpecResult ¶
type ProcessSpecResult struct {
Done bool
Endpoints []APIEndpoint
ToolCalls []ToolCall
Messages []ChatMessage
}
type ReasoningCallback ¶
ReasoningCallback is called for each chunk as it's streamed isThought=true for reasoning chunks, false for text chunks
type Test ¶
type Test struct {
TestCase TestCase `json:"test_case"`
Status TestStatus `json:"status"`
Analysis string `json:"analysis,omitempty"`
}
type TestCase ¶
type TestCase struct {
ID int `json:"id"`
Description string `json:"description"`
Method string `json:"method"`
Endpoint string `json:"endpoint"`
Headers map[string]string `json:"headers,omitempty"`
Body interface{} `json:"body,omitempty"`
ExpectedStatus int `json:"expected_status"`
Reasoning string `json:"reasoning"`
RequiresAuth bool `json:"requires_auth"`
}
type TestStatus ¶
type TestStatus string
const ( StatusPending TestStatus = "pending" StatusRunning TestStatus = "running" StatusPassed TestStatus = "passed" StatusFailed TestStatus = "failed" )
Click to show internal directories.
Click to hide internal directories.