mirror of
https://github.com/httprunner/httprunner.git
synced 2026-07-11 23:41:44 +08:00
feat: set LLMService/CVService for case runner
This commit is contained in:
15
config.go
15
config.go
@@ -4,6 +4,7 @@ import (
|
||||
"reflect"
|
||||
|
||||
"github.com/httprunner/httprunner/v5/internal/builtin"
|
||||
"github.com/httprunner/httprunner/v5/uixt/ai"
|
||||
"github.com/httprunner/httprunner/v5/uixt/option"
|
||||
)
|
||||
|
||||
@@ -42,6 +43,8 @@ type TConfig struct {
|
||||
Path string `json:"path,omitempty" yaml:"path,omitempty"` // testcase file path
|
||||
PluginSetting *PluginConfig `json:"plugin,omitempty" yaml:"plugin,omitempty"` // plugin config
|
||||
IgnorePopup bool `json:"ignore_popup,omitempty" yaml:"ignore_popup,omitempty"`
|
||||
LLMService ai.LLMServiceType `json:"llm_service,omitempty" yaml:"llm_service,omitempty"`
|
||||
CVService ai.CVServiceType `json:"cv_service,omitempty" yaml:"cv_service,omitempty"`
|
||||
}
|
||||
|
||||
func (c *TConfig) Get() *TConfig {
|
||||
@@ -108,6 +111,18 @@ func (c *TConfig) SetWeight(weight int) *TConfig {
|
||||
return c
|
||||
}
|
||||
|
||||
// SetLLMService sets LLM service for current testcase.
|
||||
func (c *TConfig) SetLLMService(llmService ai.LLMServiceType) *TConfig {
|
||||
c.LLMService = llmService
|
||||
return c
|
||||
}
|
||||
|
||||
// SetCVService sets CV service for current testcase.
|
||||
func (c *TConfig) SetCVService(cvService ai.CVServiceType) *TConfig {
|
||||
c.CVService = cvService
|
||||
return c
|
||||
}
|
||||
|
||||
func (c *TConfig) SetWebSocket(times, interval, timeout, size int64) *TConfig {
|
||||
c.WebSocketSetting = &WebSocketConfig{
|
||||
ReconnectionTimes: times,
|
||||
|
||||
Reference in New Issue
Block a user