Skip to content

Commit

Permalink
Release v0.3.22
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Apr 17, 2024
1 parent 7f04e76 commit c906827
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 15 deletions.
2 changes: 1 addition & 1 deletion core/client_option.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@ func (c *ClientOptions) cloneHeader() http.Header {
headers := c.HTTPHeader.Clone()
headers.Set("X-Fern-Language", "Go")
headers.Set("X-Fern-SDK-Name", "github.com/vellum-ai/vellum-client-go")
headers.Set("X-Fern-SDK-Version", "v0.3.21")
headers.Set("X-Fern-SDK-Version", "v0.3.22")
return headers
}
6 changes: 6 additions & 0 deletions test_suite_runs.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ type TestSuiteRunCreateRequest struct {
}

type TestSuiteRunsListExecutionsRequest struct {
// The response fields to expand for more information.
//
// - 'results.metric_results.metric_label' expands the metric label for each metric result.
// - 'results.metric_results.metric_definition' expands the metric definition for each metric result.
// - 'results.metric_results.metric_definition.name' expands the metric definition name for each metric result.
Expand []*string `json:"-"`
// Number of results to return per page.
Limit *int `json:"-"`
// The initial index from which to return the results.
Expand Down
3 changes: 3 additions & 0 deletions testsuiteruns/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ func (c *Client) ListExecutions(ctx context.Context, id string, request *vellumc
endpointURL := fmt.Sprintf(baseURL+"/"+"v1/test-suite-runs/%v/executions", id)

queryParams := make(url.Values)
for _, value := range request.Expand {
queryParams.Add("expand", fmt.Sprintf("%v", *value))
}
if request.Limit != nil {
queryParams.Add("limit", fmt.Sprintf("%v", *request.Limit))
}
Expand Down
105 changes: 91 additions & 14 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -4480,9 +4480,10 @@ func (m *ModelVersionSandboxSnapshot) String() string {
return fmt.Sprintf("%#v", m)
}

// Named Test Case value that is of type CHAT_HISTORY
type NamedTestCaseChatHistoryVariableValueRequest struct {
Name string `json:"name"`
Value []*ChatMessageRequest `json:"value,omitempty"`
Name string `json:"name"`

_rawJSON json.RawMessage
}
Expand Down Expand Up @@ -4510,9 +4511,10 @@ func (n *NamedTestCaseChatHistoryVariableValueRequest) String() string {
return fmt.Sprintf("%#v", n)
}

// Named Test Case value that is of type ERROR
type NamedTestCaseErrorVariableValueRequest struct {
Name string `json:"name"`
Value *VellumErrorRequest `json:"value,omitempty"`
Name string `json:"name"`

_rawJSON json.RawMessage
}
Expand Down Expand Up @@ -4540,9 +4542,10 @@ func (n *NamedTestCaseErrorVariableValueRequest) String() string {
return fmt.Sprintf("%#v", n)
}

// Named Test Case value that is of type JSON
type NamedTestCaseJsonVariableValueRequest struct {
Name string `json:"name"`
Value map[string]interface{} `json:"value,omitempty"`
Name string `json:"name"`

_rawJSON json.RawMessage
}
Expand Down Expand Up @@ -4570,9 +4573,10 @@ func (n *NamedTestCaseJsonVariableValueRequest) String() string {
return fmt.Sprintf("%#v", n)
}

// Named Test Case value that is of type NUMBER
type NamedTestCaseNumberVariableValueRequest struct {
Name string `json:"name"`
Value *float64 `json:"value,omitempty"`
Name string `json:"name"`

_rawJSON json.RawMessage
}
Expand Down Expand Up @@ -4600,9 +4604,10 @@ func (n *NamedTestCaseNumberVariableValueRequest) String() string {
return fmt.Sprintf("%#v", n)
}

// Named Test Case value that is of type SEARCH_RESULTS
type NamedTestCaseSearchResultsVariableValueRequest struct {
Name string `json:"name"`
Value []*SearchResultRequest `json:"value,omitempty"`
Name string `json:"name"`

_rawJSON json.RawMessage
}
Expand Down Expand Up @@ -4630,9 +4635,10 @@ func (n *NamedTestCaseSearchResultsVariableValueRequest) String() string {
return fmt.Sprintf("%#v", n)
}

// Named Test Case value that is of type STRING
type NamedTestCaseStringVariableValueRequest struct {
Name string `json:"name"`
Value *string `json:"value,omitempty"`
Name string `json:"name"`

_rawJSON json.RawMessage
}
Expand Down Expand Up @@ -6467,6 +6473,7 @@ type PromptTemplateBlock struct {
Id string `json:"id"`
BlockType BlockTypeEnum `json:"block_type,omitempty"`
Properties *PromptTemplateBlockProperties `json:"properties,omitempty"`
State *PromptTemplateBlockState `json:"state,omitempty"`

_rawJSON json.RawMessage
}
Expand Down Expand Up @@ -6634,6 +6641,7 @@ type PromptTemplateBlockRequest struct {
Id string `json:"id"`
BlockType BlockTypeEnum `json:"block_type,omitempty"`
Properties *PromptTemplateBlockPropertiesRequest `json:"properties,omitempty"`
State *PromptTemplateBlockState `json:"state,omitempty"`

_rawJSON json.RawMessage
}
Expand Down Expand Up @@ -6661,6 +6669,30 @@ func (p *PromptTemplateBlockRequest) String() string {
return fmt.Sprintf("%#v", p)
}

// - `ENABLED` - ENABLED
// - `DISABLED` - DISABLED
type PromptTemplateBlockState string

const (
PromptTemplateBlockStateEnabled PromptTemplateBlockState = "ENABLED"
PromptTemplateBlockStateDisabled PromptTemplateBlockState = "DISABLED"
)

func NewPromptTemplateBlockStateFromString(s string) (PromptTemplateBlockState, error) {
switch s {
case "ENABLED":
return PromptTemplateBlockStateEnabled, nil
case "DISABLED":
return PromptTemplateBlockStateDisabled, nil
}
var t PromptTemplateBlockState
return "", fmt.Errorf("%s is not a valid %T", s, t)
}

func (p PromptTemplateBlockState) Ptr() *PromptTemplateBlockState {
return &p
}

// - `ANTHROPIC` - Anthropic
// - `AWS_BEDROCK` - AWS Bedrock
// - `AZURE_OPENAI` - Azure OpenAI
Expand Down Expand Up @@ -10141,9 +10173,11 @@ func (t *TestSuiteRunExecution) String() string {
return fmt.Sprintf("%#v", t)
}

// Execution output of an entity evaluated during a Test Suite Run that is of type CHAT_HISTORY
type TestSuiteRunExecutionChatHistoryOutput struct {
OutputVariableId string `json:"output_variable_id"`
Name string `json:"name"`
Value []*ChatMessage `json:"value,omitempty"`
OutputVariableId string `json:"output_variable_id"`

_rawJSON json.RawMessage
}
Expand Down Expand Up @@ -10171,9 +10205,11 @@ func (t *TestSuiteRunExecutionChatHistoryOutput) String() string {
return fmt.Sprintf("%#v", t)
}

// Execution output of an entity evaluated during a Test Suite Run that is of type ERROR
type TestSuiteRunExecutionErrorOutput struct {
OutputVariableId string `json:"output_variable_id"`
Name string `json:"name"`
Value *VellumError `json:"value,omitempty"`
OutputVariableId string `json:"output_variable_id"`

_rawJSON json.RawMessage
}
Expand Down Expand Up @@ -10201,9 +10237,11 @@ func (t *TestSuiteRunExecutionErrorOutput) String() string {
return fmt.Sprintf("%#v", t)
}

// Execution output of an entity evaluated during a Test Suite Run that is of type JSON
type TestSuiteRunExecutionJsonOutput struct {
OutputVariableId string `json:"output_variable_id"`
Name string `json:"name"`
Value map[string]interface{} `json:"value,omitempty"`
OutputVariableId string `json:"output_variable_id"`

_rawJSON json.RawMessage
}
Expand Down Expand Up @@ -10231,9 +10269,42 @@ func (t *TestSuiteRunExecutionJsonOutput) String() string {
return fmt.Sprintf("%#v", t)
}

type TestSuiteRunExecutionMetricDefinition struct {
Id *string `json:"id,omitempty"`
Label *string `json:"label,omitempty"`
Name *string `json:"name,omitempty"`

_rawJSON json.RawMessage
}

func (t *TestSuiteRunExecutionMetricDefinition) UnmarshalJSON(data []byte) error {
type unmarshaler TestSuiteRunExecutionMetricDefinition
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*t = TestSuiteRunExecutionMetricDefinition(value)
t._rawJSON = json.RawMessage(data)
return nil
}

func (t *TestSuiteRunExecutionMetricDefinition) String() string {
if len(t._rawJSON) > 0 {
if value, err := core.StringifyJSON(t._rawJSON); err == nil {
return value
}
}
if value, err := core.StringifyJSON(t); err == nil {
return value
}
return fmt.Sprintf("%#v", t)
}

type TestSuiteRunExecutionMetricResult struct {
MetricId string `json:"metric_id"`
Outputs []*TestSuiteRunMetricOutput `json:"outputs,omitempty"`
MetricId string `json:"metric_id"`
Outputs []*TestSuiteRunMetricOutput `json:"outputs,omitempty"`
MetricLabel *string `json:"metric_label,omitempty"`
MetricDefinition *TestSuiteRunExecutionMetricDefinition `json:"metric_definition,omitempty"`

_rawJSON json.RawMessage
}
Expand Down Expand Up @@ -10261,9 +10332,11 @@ func (t *TestSuiteRunExecutionMetricResult) String() string {
return fmt.Sprintf("%#v", t)
}

// Execution output of an entity evaluated during a Test Suite Run that is of type NUMBER
type TestSuiteRunExecutionNumberOutput struct {
OutputVariableId string `json:"output_variable_id"`
Name string `json:"name"`
Value *float64 `json:"value,omitempty"`
OutputVariableId string `json:"output_variable_id"`

_rawJSON json.RawMessage
}
Expand Down Expand Up @@ -10463,9 +10536,11 @@ func (t *TestSuiteRunExecutionOutput) Accept(visitor TestSuiteRunExecutionOutput
}
}

// Execution output of an entity evaluated during a Test Suite Run that is of type SEARCH_RESULTS
type TestSuiteRunExecutionSearchResultsOutput struct {
OutputVariableId string `json:"output_variable_id"`
Name string `json:"name"`
Value []*SearchResult `json:"value,omitempty"`
OutputVariableId string `json:"output_variable_id"`

_rawJSON json.RawMessage
}
Expand Down Expand Up @@ -10493,9 +10568,11 @@ func (t *TestSuiteRunExecutionSearchResultsOutput) String() string {
return fmt.Sprintf("%#v", t)
}

// Execution output of an entity evaluated during a Test Suite Run that is of type STRING
type TestSuiteRunExecutionStringOutput struct {
OutputVariableId string `json:"output_variable_id"`
Name string `json:"name"`
Value *string `json:"value,omitempty"`
OutputVariableId string `json:"output_variable_id"`

_rawJSON json.RawMessage
}
Expand Down

0 comments on commit c906827

Please sign in to comment.