Skip to content

Commit

Permalink
SDK regeneration
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Feb 21, 2025
1 parent 343b75d commit 9cbd53e
Show file tree
Hide file tree
Showing 4 changed files with 177 additions and 5 deletions.
2 changes: 1 addition & 1 deletion core/request_option.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func (r *RequestOptions) cloneHeader() http.Header {
headers := r.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.14.5")
headers.Set("X-Fern-SDK-Version", "v0.0.2305")
return headers
}

Expand Down
8 changes: 4 additions & 4 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type ExecutePromptRequest struct {
PromptDeploymentName *string `json:"prompt_deployment_name,omitempty" url:"-"`
// Optionally specify a release tag if you want to pin to a specific release of the Prompt Deployment
ReleaseTag *string `json:"release_tag,omitempty" url:"-"`
// Optionally include a unique identifier for tracking purposes. Must be unique within a given Prompt Deployment.
// Optionally include a unique identifier for tracking purposes. Must be unique within a given Workspace.
ExternalId *string `json:"external_id,omitempty" url:"-"`
// An optionally specified configuration used to opt in to including additional metadata about this prompt execution in the API response. Corresponding values will be returned under the `meta` key of the API response.
ExpandMeta *PromptDeploymentExpandMetaRequest `json:"expand_meta,omitempty" url:"-"`
Expand All @@ -55,7 +55,7 @@ type ExecutePromptStreamRequest struct {
PromptDeploymentName *string `json:"prompt_deployment_name,omitempty" url:"-"`
// Optionally specify a release tag if you want to pin to a specific release of the Prompt Deployment
ReleaseTag *string `json:"release_tag,omitempty" url:"-"`
// Optionally include a unique identifier for tracking purposes. Must be unique within a given Prompt Deployment.
// Optionally include a unique identifier for tracking purposes. Must be unique within a given Workspace.
ExternalId *string `json:"external_id,omitempty" url:"-"`
// An optionally specified configuration used to opt in to including additional metadata about this prompt execution in the API response. Corresponding values will be returned under the `meta` key of the API response.
ExpandMeta *PromptDeploymentExpandMetaRequest `json:"expand_meta,omitempty" url:"-"`
Expand All @@ -78,7 +78,7 @@ type ExecuteWorkflowRequest struct {
WorkflowDeploymentName *string `json:"workflow_deployment_name,omitempty" url:"-"`
// Optionally specify a release tag if you want to pin to a specific release of the Workflow Deployment
ReleaseTag *string `json:"release_tag,omitempty" url:"-"`
// Optionally include a unique identifier for tracking purposes. Must be unique for a given workflow deployment.
// Optionally include a unique identifier for tracking purposes. Must be unique within a given Workspace.
ExternalId *string `json:"external_id,omitempty" url:"-"`
// Arbitrary JSON metadata associated with this request. Can be used to capture additional monitoring data such as user id, session id, etc. for future analysis.
Metadata map[string]interface{} `json:"metadata,omitempty" url:"-"`
Expand All @@ -95,7 +95,7 @@ type ExecuteWorkflowStreamRequest struct {
WorkflowDeploymentName *string `json:"workflow_deployment_name,omitempty" url:"-"`
// Optionally specify a release tag if you want to pin to a specific release of the Workflow Deployment
ReleaseTag *string `json:"release_tag,omitempty" url:"-"`
// Optionally include a unique identifier for tracking purposes. Must be unique for a given workflow deployment.
// Optionally include a unique identifier for tracking purposes. Must be unique within a given Workspace.
ExternalId *string `json:"external_id,omitempty" url:"-"`
// Optionally specify which events you want to receive. Defaults to only WORKFLOW events. Note that the schema of non-WORKFLOW events is unstable and should be used with caution.
EventTypes []WorkflowExecutionEventType `json:"event_types,omitempty" url:"-"`
Expand Down
126 changes: 126 additions & 0 deletions workflow_sandboxes.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

package api

import (
json "encoding/json"
fmt "fmt"
core "github.com/vellum-ai/vellum-client-go/core"
)

type DeploySandboxWorkflowRequest struct {
// The Vellum-generated ID of the Workflow Deployment you'd like to update. Cannot specify both this and workflow_deployment_name. Leave null to create a new Workflow Deployment.
WorkflowDeploymentId *string `json:"workflow_deployment_id,omitempty" url:"-"`
Expand All @@ -12,3 +18,123 @@ type DeploySandboxWorkflowRequest struct {
// Optionally provide the release tags that you'd like to be associated with the latest release of the created/updated Prompt Deployment.
ReleaseTags []string `json:"release_tags,omitempty" url:"-"`
}

type ListWorkflowSandboxExamplesRequest struct {
// Number of results to return per page.
Limit *int `json:"-" url:"limit,omitempty"`
// The initial index from which to return the results.
Offset *int `json:"-" url:"offset,omitempty"`
// Which field to use when ordering the results.
Ordering *string `json:"-" url:"ordering,omitempty"`
Tag *ListWorkflowSandboxExamplesRequestTag `json:"-" url:"tag,omitempty"`
}

type PaginatedWorkflowSandboxExampleList struct {
Count *int `json:"count,omitempty" url:"count,omitempty"`
Next *string `json:"next,omitempty" url:"next,omitempty"`
Previous *string `json:"previous,omitempty" url:"previous,omitempty"`
Results []*WorkflowSandboxExample `json:"results,omitempty" url:"results,omitempty"`

extraProperties map[string]interface{}
_rawJSON json.RawMessage
}

func (p *PaginatedWorkflowSandboxExampleList) GetExtraProperties() map[string]interface{} {
return p.extraProperties
}

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

extraProperties, err := core.ExtractExtraProperties(data, *p)
if err != nil {
return err
}
p.extraProperties = extraProperties

p._rawJSON = json.RawMessage(data)
return nil
}

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

type WorkflowSandboxExample struct {
Id string `json:"id" url:"id"`
Label string `json:"label" url:"label"`
Description *string `json:"description,omitempty" url:"description,omitempty"`
IconName *string `json:"icon_name,omitempty" url:"icon_name,omitempty"`

extraProperties map[string]interface{}
_rawJSON json.RawMessage
}

func (w *WorkflowSandboxExample) GetExtraProperties() map[string]interface{} {
return w.extraProperties
}

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

extraProperties, err := core.ExtractExtraProperties(data, *w)
if err != nil {
return err
}
w.extraProperties = extraProperties

w._rawJSON = json.RawMessage(data)
return nil
}

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

type ListWorkflowSandboxExamplesRequestTag string

const (
ListWorkflowSandboxExamplesRequestTagOnboarding ListWorkflowSandboxExamplesRequestTag = "ONBOARDING"
ListWorkflowSandboxExamplesRequestTagTemplates ListWorkflowSandboxExamplesRequestTag = "TEMPLATES"
)

func NewListWorkflowSandboxExamplesRequestTagFromString(s string) (ListWorkflowSandboxExamplesRequestTag, error) {
switch s {
case "ONBOARDING":
return ListWorkflowSandboxExamplesRequestTagOnboarding, nil
case "TEMPLATES":
return ListWorkflowSandboxExamplesRequestTagTemplates, nil
}
var t ListWorkflowSandboxExamplesRequestTag
return "", fmt.Errorf("%s is not a valid %T", s, t)
}

func (l ListWorkflowSandboxExamplesRequestTag) Ptr() *ListWorkflowSandboxExamplesRequestTag {
return &l
}
46 changes: 46 additions & 0 deletions workflowsandboxes/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,49 @@ func (c *Client) DeployWorkflow(
}
return response, nil
}

// List Workflow Sandbox examples that were previously cloned into the User's Workspace
func (c *Client) ListWorkflowSandboxExamples(
ctx context.Context,
request *vellumclientgo.ListWorkflowSandboxExamplesRequest,
opts ...option.RequestOption,
) (*vellumclientgo.PaginatedWorkflowSandboxExampleList, error) {
options := core.NewRequestOptions(opts...)

baseURL := "https://api.vellum.ai"
if c.baseURL != "" {
baseURL = c.baseURL
}
if options.BaseURL != "" {
baseURL = options.BaseURL
}
endpointURL := baseURL + "/v1/workflow-sandboxes/examples"

queryParams, err := core.QueryValues(request)
if err != nil {
return nil, err
}
if len(queryParams) > 0 {
endpointURL += "?" + queryParams.Encode()
}

headers := core.MergeHeaders(c.header.Clone(), options.ToHeader())

var response *vellumclientgo.PaginatedWorkflowSandboxExampleList
if err := c.caller.Call(
ctx,
&core.CallParams{
URL: endpointURL,
Method: http.MethodGet,
MaxAttempts: options.MaxAttempts,
Headers: headers,
BodyProperties: options.BodyProperties,
QueryParameters: options.QueryParameters,
Client: options.HTTPClient,
Response: &response,
},
); err != nil {
return nil, err
}
return response, nil
}

0 comments on commit 9cbd53e

Please sign in to comment.