Documentation ¶
Overview ¶
Example (AssistantsUsingCodeInterpreter) ¶
//go:build go1.18 // +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. package main import ( "context" "fmt" "log" "os" "time" "github.com/Azure/azure-sdk-for-go/sdk/ai/azopenaiassistants" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" ) func main() { azureOpenAIKey := os.Getenv("AOAI_ASSISTANTS_KEY") // Ex: "https://<your-azure-openai-host>.openai.azure.com" azureOpenAIEndpoint := os.Getenv("AOAI_ASSISTANTS_ENDPOINT") if azureOpenAIKey == "" || azureOpenAIEndpoint == "" { fmt.Fprintf(os.Stderr, "Skipping example, environment variables missing\n") return } keyCredential := azcore.NewKeyCredential(azureOpenAIKey) client, err := azopenaiassistants.NewClientWithKeyCredential(azureOpenAIEndpoint, keyCredential, nil) if err != nil { // TODO: Update the following line with your application specific error handling logic log.Fatalf("ERROR: %s", err) } assistantName := fmt.Sprintf("your-assistant-name-%d", time.Now().UnixNano()) if err != nil { // TODO: Update the following line with your application specific error handling logic log.Fatalf("ERROR: %s", err) } // First, let's create an assistant. createAssistantResp, err := client.CreateAssistant(context.Background(), azopenaiassistants.AssistantCreationBody{ Name: &assistantName, DeploymentName: to.Ptr("gpt-4-1106-preview"), Instructions: to.Ptr("You are an AI assistant that can write code to help answer math questions."), Tools: []azopenaiassistants.ToolDefinitionClassification{ &azopenaiassistants.CodeInterpreterToolDefinition{}, // others... // &azopenaiassistants.FunctionToolDefinition{} // &azopenaiassistants.RetrievalToolDefinition{} }, }, nil) if err != nil { // TODO: Update the following line with your application specific error handling logic log.Fatalf("ERROR: %s", err) } assistantID := createAssistantResp.ID // cleanup the assistant after this example. Remove this if you want to re-use the assistant. defer func() { _, err := client.DeleteAssistant(context.TODO(), *assistantID, nil) if err != nil { // TODO: Update the following line with your application specific error handling logic log.Fatalf("ERROR: %s", err) } }() // Now we'll create a thread. The thread is where you will add messages, which can later // be evaluated using a Run. A thread can be re-used by multiple Runs. createThreadResp, err := client.CreateThread(context.TODO(), azopenaiassistants.AssistantThreadCreationOptions{}, nil) if err != nil { // TODO: Update the following line with your application specific error handling logic log.Fatalf("ERROR: %s", err) } threadID := *createThreadResp.ID // Add a user question to the thread ourQuestion, err := client.CreateMessage(context.TODO(), threadID, azopenaiassistants.CreateMessageBody{ Content: to.Ptr("I need to solve the equation `3x + 11 = 14`. Can you help me?"), Role: to.Ptr(azopenaiassistants.MessageRoleUser), }, nil) if err != nil { // TODO: Update the following line with your application specific error handling logic log.Fatalf("ERROR: %s", err) } fmt.Fprintf(os.Stderr, "[USER] I need to solve the equation `3x + 11 = 14`. Can you help me?\n") // Run the thread and wait (using pollRunEnd) until it completes. threadRun, err := client.CreateRun(context.TODO(), threadID, azopenaiassistants.CreateRunBody{ AssistantID: assistantID, }, nil) if err != nil { // TODO: Update the following line with your application specific error handling logic log.Fatalf("ERROR: %s", err) } // Wait till the assistant has responded if err := pollCodeInterpreterEnd(context.TODO(), client, threadID, *threadRun.ID); err != nil { // TODO: Update the following line with your application specific error handling logic log.Fatalf("ERROR: %s", err) } // retrieve any messages added after we asked our question. listMessagesPager := client.NewListMessagesPager(threadID, &azopenaiassistants.ListMessagesOptions{ After: ourQuestion.ID, Order: to.Ptr(azopenaiassistants.ListSortOrderAscending), }) for listMessagesPager.More() { page, err := listMessagesPager.NextPage(context.Background()) if err != nil { // TODO: Update the following line with your application specific error handling logic log.Fatalf("ERROR: %s", err) } for _, threadMessage := range page.Data { for _, content := range threadMessage.Content { switch v := content.(type) { case *azopenaiassistants.MessageTextContent: fmt.Fprintf(os.Stderr, "[ASSISTANT] %s: Text response: %s\n", *threadMessage.ID, *v.Text.Value) } } } } } func pollCodeInterpreterEnd(ctx context.Context, client *azopenaiassistants.Client, threadID string, runID string) error { for { lastGetRunResp, err := client.GetRun(context.Background(), threadID, runID, nil) if err != nil { return err } if *lastGetRunResp.Status != azopenaiassistants.RunStatusQueued && *lastGetRunResp.Status != azopenaiassistants.RunStatusInProgress { if *lastGetRunResp.Status == azopenaiassistants.RunStatusCompleted { return nil } return fmt.Errorf("run ended but status was not complete: %s", *lastGetRunResp.Status) } select { case <-time.After(500 * time.Millisecond): case <-ctx.Done(): return ctx.Err() } } }
Output:
Example (AssistantsUsingFunctionTool) ¶
//go:build go1.18 // +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. package main import ( "context" "encoding/json" "fmt" "log" "os" "time" "github.com/Azure/azure-sdk-for-go/sdk/ai/azopenaiassistants" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" ) func main() { azureOpenAIKey := os.Getenv("AOAI_ASSISTANTS_KEY") // Ex: "https://<your-azure-openai-host>.openai.azure.com" azureOpenAIEndpoint := os.Getenv("AOAI_ASSISTANTS_ENDPOINT") if azureOpenAIKey == "" || azureOpenAIEndpoint == "" { fmt.Fprintf(os.Stderr, "Skipping example, environment variables missing\n") return } keyCredential := azcore.NewKeyCredential(azureOpenAIKey) client, err := azopenaiassistants.NewClientWithKeyCredential(azureOpenAIEndpoint, keyCredential, nil) if err != nil { // TODO: Update the following line with your application specific error handling logic log.Fatalf("ERROR: %s", err) } assistantName := fmt.Sprintf("your-assistant-name-%d", time.Now().UnixNano()) if err != nil { // TODO: Update the following line with your application specific error handling logic log.Fatalf("ERROR: %s", err) } getWeatherFunctionTool := &azopenaiassistants.FunctionToolDefinition{ Function: &azopenaiassistants.FunctionDefinition{ Name: to.Ptr("get_current_weather"), Parameters: map[string]any{ "required": []string{"location"}, "type": "object", "properties": map[string]any{ "location": map[string]any{ "type": "string", "description": "The city and state, e.g. San Francisco, CA", }, "unit": map[string]any{ "type": "string", "enum": []string{"celsius", "fahrenheit"}, }, }, }, }, } // First, let's create an assistant. createAssistantResp, err := client.CreateAssistant(context.Background(), azopenaiassistants.AssistantCreationBody{ Name: &assistantName, DeploymentName: to.Ptr("gpt-4-1106-preview"), Instructions: to.Ptr("You are a personal math tutor. Write and run code to answer math questions."), Tools: []azopenaiassistants.ToolDefinitionClassification{ // Defines a function with a signature like this: // get_current_weather(location string, unit string) getWeatherFunctionTool, }, }, nil) if err != nil { // TODO: Update the following line with your application specific error handling logic log.Fatalf("ERROR: %s", err) } // create our thread and a run for our question "What's the weather like in Boston, MA, in celsius?" question := "What's the weather like in Boston, MA, in celsius?" fmt.Fprintf(os.Stderr, "Asking the question: '%s'\n", question) var lastMessageID, runID, threadID string { fmt.Fprintf(os.Stderr, "Creating our thread\n") createThreadResp, err := client.CreateThread(context.Background(), azopenaiassistants.AssistantThreadCreationOptions{}, nil) if err != nil { // TODO: Update the following line with your application specific error handling logic log.Fatalf("ERROR: %s", err) } threadID = *createThreadResp.ID msgResponse, err := client.CreateMessage(context.Background(), threadID, azopenaiassistants.CreateMessageBody{ Content: &question, Role: to.Ptr(azopenaiassistants.MessageRoleUser), }, nil) if err != nil { // TODO: Update the following line with your application specific error handling logic log.Fatalf("ERROR: %s", err) } lastMessageID = *msgResponse.ID // run the thread fmt.Fprintf(os.Stderr, "Creating our run for thread %s\n", *createThreadResp.ID) createRunResp, err := client.CreateRun(context.Background(), *createThreadResp.ID, azopenaiassistants.CreateRunBody{ AssistantID: createAssistantResp.ID, Instructions: to.Ptr("Use functions to answer questions, when possible."), }, nil) if err != nil { // TODO: Update the following line with your application specific error handling logic log.Fatalf("ERROR: %s", err) } runID = *createRunResp.ID } fmt.Fprintf(os.Stderr, "Waiting for the Run status to indicate it needs tool outputs\n") // NOTE: see https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/ai/azopenaiassistants#example-package-AssistantsConversationLoop // for the pollUntilRunEnds function. lastResp, err := pollUntilRunEnds(context.Background(), client, threadID, runID) if err != nil { // TODO: Update the following line with your application specific error handling logic log.Fatalf("ERROR: %s", err) } // Our question that we asked requires a tool to answer. // *lastResp.Status == azopenaiassistants.RunStatusRequiresAction fmt.Fprintf(os.Stderr, "Got run status %s\n", *lastResp.Status) fmt.Fprintf(os.Stderr, "Check the response for information we need to submit tool outputs\n") var weatherFuncArgs *WeatherFuncArgs var funcToolCall *azopenaiassistants.RequiredFunctionToolCall { // the arguments we need to run the next thing are inside of the run submitToolsAction, ok := lastResp.RequiredAction.(*azopenaiassistants.SubmitToolOutputsAction) if !ok { // TODO: Update the following line with your application specific error handling logic log.Fatalf("ERROR: did not get an azopenaiassistants.SubmitToolOutputsAction as our required action") } tmpFuncToolCall, ok := submitToolsAction.SubmitToolOutputs.ToolCalls[0].(*azopenaiassistants.RequiredFunctionToolCall) if !ok || *tmpFuncToolCall.Function.Name != "get_current_weather" { // TODO: Update the following line with your application specific error handling logic log.Fatalf("ERROR: did not get an azopenaiassistants.RequiredFunctionToolCall as our required action, or got an incorrect function name") } if err := json.Unmarshal([]byte(*tmpFuncToolCall.Function.Arguments), &weatherFuncArgs); err != nil { // TODO: Update the following line with your application specific error handling logic log.Fatalf("ERROR: %s", err) } funcToolCall = tmpFuncToolCall } // now call the function (OpenAI is providing the arguments) fmt.Fprintf(os.Stderr, "Call our own function to get the weather for %s, in %s\n", weatherFuncArgs.Location, weatherFuncArgs.Unit) { // submit our outputs from evaluating the tool _, err := client.SubmitToolOutputsToRun(context.Background(), threadID, runID, azopenaiassistants.SubmitToolOutputsToRunBody{ ToolOutputs: []azopenaiassistants.ToolOutput{ { Output: to.Ptr("0C"), ToolCallID: funcToolCall.ID, }, }, }, nil) if err != nil { // TODO: Update the following line with your application specific error handling logic log.Fatalf("ERROR: %s", err) } } // the run will restart now, we just need to wait until it finishes // NOTE: see https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/ai/azopenaiassistants#example-package-AssistantsConversationLoop // for the pollUntilRunEnds function. lastResp, err = pollUntilRunEnds(context.Background(), client, threadID, runID) if err != nil || *lastResp.Status != azopenaiassistants.RunStatusCompleted { // TODO: Update the following line with your application specific error handling logic log.Fatalf("ERROR: %s", err) } fmt.Fprintf(os.Stderr, "Get responses from the assistant, based on our tool outputs\n") // NOTE: see https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/ai/azopenaiassistants#example-package-AssistantsConversationLoop // for the getLatestMessages function. latestMessages, err := getLatestMessages(context.Background(), client, threadID, &lastMessageID) if err != nil { // TODO: Update the following line with your application specific error handling logic log.Fatalf("ERROR: %s", err) } if len(latestMessages) > 0 { // Prints something like: // [ASSISTANT] <id>: Text response: The current weather in Boston, MA, measured in Celsius, is 0°C. // NOTE: see https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/ai/azopenaiassistants#example-package-AssistantsConversationLoop // for the printAssistantMessages function. err = printAssistantMessages(context.Background(), client, latestMessages) if err != nil { // TODO: Update the following line with your application specific error handling logic log.Fatalf("ERROR: %s", err) } } } type WeatherFuncArgs struct { Location string Unit string }
Output:
Example (AssistantsWithConversationLoop) ¶
//go:build go1.18 // +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. package main import ( "context" "errors" "fmt" "io" "log" "os" "time" "github.com/Azure/azure-sdk-for-go/sdk/ai/azopenaiassistants" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" ) func main() { azureOpenAIKey := os.Getenv("AOAI_ASSISTANTS_KEY") // Ex: "https://<your-azure-openai-host>.openai.azure.com" azureOpenAIEndpoint := os.Getenv("AOAI_ASSISTANTS_ENDPOINT") if azureOpenAIKey == "" || azureOpenAIEndpoint == "" { fmt.Fprintf(os.Stderr, "Skipping example, environment variables missing\n") return } keyCredential := azcore.NewKeyCredential(azureOpenAIKey) client, err := azopenaiassistants.NewClientWithKeyCredential(azureOpenAIEndpoint, keyCredential, nil) if err != nil { // TODO: Update the following line with your application specific error handling logic log.Fatalf("ERROR: %s", err) } assistantName := fmt.Sprintf("your-assistant-name-%d", time.Now().UnixNano()) if err != nil { // TODO: Update the following line with your application specific error handling logic log.Fatalf("ERROR: %s", err) } // First, let's create an assistant. createAssistantResp, err := client.CreateAssistant(context.Background(), azopenaiassistants.AssistantCreationBody{ Name: &assistantName, DeploymentName: to.Ptr("gpt-4-1106-preview"), Instructions: to.Ptr("You are a personal math tutor. Write and run code to answer math questions."), Tools: []azopenaiassistants.ToolDefinitionClassification{ &azopenaiassistants.CodeInterpreterToolDefinition{}, // others... // &azopenaiassistants.FunctionToolDefinition{} // &azopenaiassistants.RetrievalToolDefinition{} }, }, nil) if err != nil { // TODO: Update the following line with your application specific error handling logic log.Fatalf("ERROR: %s", err) } assistantID := createAssistantResp.ID // cleanup the assistant after this example. Remove this if you want to re-use the assistant. defer func() { _, err := client.DeleteAssistant(context.TODO(), *assistantID, nil) if err != nil { // TODO: Update the following line with your application specific error handling logic log.Fatalf("ERROR: %s", err) } }() // Now we'll create a thread. The thread is where you will add messages, which can later // be evaluated using a Run. A thread can be re-used by multiple Runs. createThreadResp, err := client.CreateThread(context.Background(), azopenaiassistants.AssistantThreadCreationOptions{}, nil) if err != nil { // TODO: Update the following line with your application specific error handling logic log.Fatalf("ERROR: %s", err) } threadID := createThreadResp.ID assistantCtx, stopAssistant := context.WithCancel(context.TODO()) callIdx := -1 // This is just a simplified example of how you could handle a conversation - `assistantMessages` are the messages that // are responses from the assistant, and you return messages from here that are then added to the conversation. handleConversation := func(ctx context.Context, assistantMessages []azopenaiassistants.ThreadMessage) ([]azopenaiassistants.CreateMessageBody, error) { callIdx++ if err := printAssistantMessages(ctx, client, assistantMessages); err != nil { return nil, err } // For this example we'll just synthesize some responses, simulating a conversation. // In a real application these messages would come from the user, responding to replies // from the assistant. switch callIdx { case 0: text := "Can you help me find the y intercept for y = x + 4?" fmt.Fprintf(os.Stderr, "[ME] %s\n", text) return []azopenaiassistants.CreateMessageBody{ {Role: to.Ptr(azopenaiassistants.MessageRoleUser), Content: &text}, }, nil case 1: text := "Can you explain it with a Python program?" fmt.Fprintf(os.Stderr, "[ME] %s\n", text) return []azopenaiassistants.CreateMessageBody{ {Role: to.Ptr(azopenaiassistants.MessageRoleUser), Content: &text}, }, nil case 2: text := "Can you give me the result if that Python program had 'x' set to 10" fmt.Fprintf(os.Stderr, "[ME] %s\n", text) return []azopenaiassistants.CreateMessageBody{ {Role: to.Ptr(azopenaiassistants.MessageRoleUser), Content: &text}, }, nil default: stopAssistant() } return nil, nil } if err = assistantLoop(assistantCtx, client, *assistantID, *threadID, handleConversation); err != nil { // if this is a cancellation error it's just us trying to stop the assistant loop. if errors.Is(err, context.Canceled) { fmt.Fprintf(os.Stderr, "Assistant stopped cleanly\n") } else { // TODO: Update the following line with your application specific error handling logic log.Fatalf("ERROR: %s\n", err) } } } // conversationHandler takes responses from an assistant and returns our reply messages. Returns the responses // based on the contents of assistantMessages // - assistantMessages - messages that have arrived since our last read of the thread. type conversationHandler func(ctx context.Context, assistantMessages []azopenaiassistants.ThreadMessage) ([]azopenaiassistants.CreateMessageBody, error) func assistantLoop(ctx context.Context, client *azopenaiassistants.Client, assistantID string, threadID string, handleConversation conversationHandler) error { // from here we'll run in a loop, adding new messages to the conversation and reading the assistants // responses. var lastAssistantResponses []azopenaiassistants.ThreadMessage for { yourResponses, err := handleConversation(ctx, lastAssistantResponses) if err != nil { return err } var lastMessageID *string for _, yourResponse := range yourResponses { // Add some messages to the thread. We will use Run the thread later to evaluate these and to get // responses from the assistant. createMessageResp, err := client.CreateMessage(context.Background(), threadID, yourResponse, nil) if err != nil { return err } // we'll always track the final message ID in the thread - when we pull responses we can be more efficient // and only grab what's new. lastMessageID = createMessageResp.ID } createRunResp, err := client.CreateRun(context.Background(), threadID, azopenaiassistants.CreateRunBody{ AssistantID: &assistantID, }, nil) if err != nil { return err } runID := *createRunResp.ID if _, err := pollUntilRunEnds(ctx, client, threadID, runID); err != nil { return err } // get all the messages that were added after our most recently added message. lastAssistantResponses, err = getLatestMessages(ctx, client, threadID, lastMessageID) if err != nil { return err } } } func printAssistantMessages(ctx context.Context, client *azopenaiassistants.Client, threadMessages []azopenaiassistants.ThreadMessage) error { // print out the response contents for debugging. for _, response := range threadMessages { for _, content := range response.Content { switch v := content.(type) { case *azopenaiassistants.MessageImageFileContent: fmt.Fprintf(os.Stderr, "[ASSISTANT] Image response, file ID: %s\n", *v.ImageFile.FileID) // Download the contents of the file through the returned reader. fileContentResp, err := client.GetFileContent(ctx, *v.ImageFile.FileID, nil) if err != nil { return err } contents, err := io.ReadAll(fileContentResp.Content) if err != nil { return err } fmt.Fprintf(os.Stderr, " File contents downloaded, length %d\n", len(contents)) case *azopenaiassistants.MessageTextContent: fmt.Fprintf(os.Stderr, "[ASSISTANT] %s: Text response: %s\n", *response.ID, *v.Text.Value) } } } return nil } func pollUntilRunEnds(ctx context.Context, client *azopenaiassistants.Client, threadID string, runID string) (azopenaiassistants.GetRunResponse, error) { for { lastGetRunResp, err := client.GetRun(context.Background(), threadID, runID, nil) if err != nil { return azopenaiassistants.GetRunResponse{}, err } if *lastGetRunResp.Status == azopenaiassistants.RunStatusCompleted || *lastGetRunResp.Status == azopenaiassistants.RunStatusRequiresAction { return lastGetRunResp, nil } if *lastGetRunResp.Status != azopenaiassistants.RunStatusQueued && *lastGetRunResp.Status != azopenaiassistants.RunStatusInProgress { return azopenaiassistants.GetRunResponse{}, fmt.Errorf("run ended but status was not complete: %s", *lastGetRunResp.Status) } select { case <-time.After(500 * time.Millisecond): case <-ctx.Done(): return azopenaiassistants.GetRunResponse{}, ctx.Err() } } } // getLatestMessages gets any messages that have occurred since lastMessageID. // If an error occurs, returns any messages received so far, as well as the error. func getLatestMessages(ctx context.Context, client *azopenaiassistants.Client, threadID string, lastMessageID *string) ([]azopenaiassistants.ThreadMessage, error) { // grab any messages that occurred after our last known message listMessagesPager := client.NewListMessagesPager(threadID, &azopenaiassistants.ListMessagesOptions{ After: lastMessageID, Order: to.Ptr(azopenaiassistants.ListSortOrderAscending), }) var all []azopenaiassistants.ThreadMessage for listMessagesPager.More() { page, err := listMessagesPager.NextPage(ctx) if err != nil { return all, err } all = append(all, page.Data...) } return all, nil }
Output:
Index ¶
- type Assistant
- type AssistantCreationBody
- type AssistantDeletionStatus
- type AssistantFile
- type AssistantFileDeletionStatus
- type AssistantFilesPage
- type AssistantThread
- type AssistantThreadCreationOptions
- type AssistantsPage
- type CancelRunOptions
- type CancelRunResponse
- type Client
- func NewClient(endpoint string, credential azcore.TokenCredential, options *ClientOptions) (*Client, error)
- func NewClientForOpenAI(endpoint string, credential *azcore.KeyCredential, options *ClientOptions) (*Client, error)
- func NewClientWithKeyCredential(endpoint string, credential *azcore.KeyCredential, options *ClientOptions) (*Client, error)
- func (client *Client) CancelRun(ctx context.Context, threadID string, runID string, options *CancelRunOptions) (CancelRunResponse, error)
- func (client *Client) CreateAssistant(ctx context.Context, body AssistantCreationBody, ...) (CreateAssistantResponse, error)
- func (client *Client) CreateAssistantFile(ctx context.Context, assistantID string, body CreateAssistantFileBody, ...) (CreateAssistantFileResponse, error)
- func (client *Client) CreateMessage(ctx context.Context, threadID string, body CreateMessageBody, ...) (CreateMessageResponse, error)
- func (client *Client) CreateRun(ctx context.Context, threadID string, body CreateRunBody, ...) (CreateRunResponse, error)
- func (client *Client) CreateThread(ctx context.Context, body AssistantThreadCreationOptions, ...) (CreateThreadResponse, error)
- func (client *Client) CreateThreadAndRun(ctx context.Context, body CreateAndRunThreadOptions, ...) (CreateThreadAndRunResponse, error)
- func (client *Client) DeleteAssistant(ctx context.Context, assistantID string, options *DeleteAssistantOptions) (DeleteAssistantResponse, error)
- func (client *Client) DeleteAssistantFile(ctx context.Context, assistantID string, fileID string, ...) (DeleteAssistantFileResponse, error)
- func (client *Client) DeleteFile(ctx context.Context, fileID string, options *DeleteFileOptions) (DeleteFileResponse, error)
- func (client *Client) DeleteThread(ctx context.Context, threadID string, options *DeleteThreadOptions) (DeleteThreadResponse, error)
- func (client *Client) GetAssistant(ctx context.Context, assistantID string, options *GetAssistantOptions) (GetAssistantResponse, error)
- func (client *Client) GetAssistantFile(ctx context.Context, assistantID string, fileID string, ...) (GetAssistantFileResponse, error)
- func (client *Client) GetFile(ctx context.Context, fileID string, options *GetFileOptions) (GetFileResponse, error)
- func (client *Client) GetFileContent(ctx context.Context, fileID string, options *GetFileContentOptions) (GetFileContentResponse, error)
- func (client *Client) GetMessage(ctx context.Context, threadID string, messageID string, ...) (GetMessageResponse, error)
- func (client *Client) GetMessageFile(ctx context.Context, threadID string, messageID string, fileID string, ...) (GetMessageFileResponse, error)
- func (client *Client) GetRun(ctx context.Context, threadID string, runID string, options *GetRunOptions) (GetRunResponse, error)
- func (client *Client) GetRunStep(ctx context.Context, threadID string, runID string, stepID string, ...) (GetRunStepResponse, error)
- func (client *Client) GetThread(ctx context.Context, threadID string, options *GetThreadOptions) (GetThreadResponse, error)
- func (client *Client) ListFiles(ctx context.Context, options *ListFilesOptions) (ListFilesResponse, error)
- func (c *Client) NewListAssistantFilesPager(assistantID string, options *ListAssistantFilesOptions) *runtime.Pager[ListAssistantFilesResponse]
- func (c *Client) NewListAssistantsPager(options *ListAssistantsOptions) *runtime.Pager[ListAssistantsResponse]
- func (c *Client) NewListMessageFilesPager(threadID string, messageID string, options *ListMessageFilesOptions) *runtime.Pager[ListMessageFilesResponse]
- func (c *Client) NewListMessagesPager(threadID string, options *ListMessagesOptions) *runtime.Pager[ListMessagesResponse]
- func (c *Client) NewListRunStepsPager(threadID string, runID string, options *ListRunStepsOptions) *runtime.Pager[ListRunStepsResponse]
- func (c *Client) NewListRunsPager(threadID string, options *ListRunsOptions) *runtime.Pager[ListRunsResponse]
- func (client *Client) SubmitToolOutputsToRun(ctx context.Context, threadID string, runID string, ...) (SubmitToolOutputsToRunResponse, error)
- func (client *Client) UpdateAssistant(ctx context.Context, assistantID string, body UpdateAssistantOptions, ...) (UpdateAssistantResponse, error)
- func (client *Client) UpdateMessage(ctx context.Context, threadID string, messageID string, body UpdateMessageBody, ...) (UpdateMessageResponse, error)
- func (client *Client) UpdateRun(ctx context.Context, threadID string, runID string, body UpdateRunBody, ...) (UpdateRunResponse, error)
- func (client *Client) UpdateThread(ctx context.Context, threadID string, body UpdateThreadBody, ...) (UpdateThreadResponse, error)
- func (client *Client) UploadFile(ctx context.Context, file io.ReadSeeker, purpose FilePurpose, ...) (UploadFileResponse, error)
- type ClientOptions
- type CodeInterpreterToolDefinition
- type CreateAndRunThreadOptions
- type CreateAssistantFileBody
- type CreateAssistantFileOptions
- type CreateAssistantFileResponse
- type CreateAssistantOptions
- type CreateAssistantResponse
- type CreateMessageBody
- type CreateMessageOptions
- type CreateMessageResponse
- type CreateRunBody
- type CreateRunOptions
- type CreateRunResponse
- type CreateThreadAndRunOptions
- type CreateThreadAndRunResponse
- type CreateThreadOptions
- type CreateThreadResponse
- type DeleteAssistantFileOptions
- type DeleteAssistantFileResponse
- type DeleteAssistantOptions
- type DeleteAssistantResponse
- type DeleteFileOptions
- type DeleteFileResponse
- type DeleteThreadOptions
- type DeleteThreadResponse
- type FileDeletionStatus
- type FileListResponse
- type FilePurpose
- type FunctionDefinition
- type FunctionToolDefinition
- type GetAssistantFileOptions
- type GetAssistantFileResponse
- type GetAssistantOptions
- type GetAssistantResponse
- type GetFileContentOptions
- type GetFileContentResponse
- type GetFileOptions
- type GetFileResponse
- type GetMessageFileOptions
- type GetMessageFileResponse
- type GetMessageOptions
- type GetMessageResponse
- type GetRunOptions
- type GetRunResponse
- type GetRunStepOptions
- type GetRunStepResponse
- type GetThreadOptions
- type GetThreadResponse
- type ListAssistantFilesOptions
- type ListAssistantFilesResponse
- type ListAssistantsOptions
- type ListAssistantsResponse
- type ListFilesOptions
- type ListFilesResponse
- type ListMessageFilesOptions
- type ListMessageFilesResponse
- type ListMessagesOptions
- type ListMessagesResponse
- type ListRunStepsOptions
- type ListRunStepsResponse
- type ListRunsOptions
- type ListRunsResponse
- type ListSortOrder
- type MessageContent
- type MessageContentClassification
- type MessageFile
- type MessageFilesPage
- type MessageImageFileContent
- type MessageImageFileDetails
- type MessageRole
- type MessageTextAnnotation
- type MessageTextAnnotationClassification
- type MessageTextContent
- type MessageTextDetails
- type MessageTextFileCitationAnnotation
- type MessageTextFileCitationDetails
- type MessageTextFilePathAnnotation
- type MessageTextFilePathDetails
- type MessagesPage
- type OpenAIFile
- type RequiredAction
- type RequiredActionClassification
- type RequiredFunctionToolCall
- type RequiredFunctionToolCallDetails
- type RequiredToolCall
- type RequiredToolCallClassification
- type RetrievalToolDefinition
- type RunError
- type RunStatus
- type RunStep
- type RunStepCodeInterpreterImageOutput
- type RunStepCodeInterpreterImageReference
- type RunStepCodeInterpreterLogOutput
- type RunStepCodeInterpreterToolCall
- type RunStepCodeInterpreterToolCallDetails
- type RunStepCodeInterpreterToolCallOutput
- type RunStepCodeInterpreterToolCallOutputClassification
- type RunStepDetails
- type RunStepDetailsClassification
- type RunStepError
- type RunStepErrorCode
- type RunStepFunctionToolCall
- type RunStepFunctionToolCallDetails
- type RunStepLastError
- type RunStepMessageCreationDetails
- type RunStepMessageCreationReference
- type RunStepRetrievalToolCall
- type RunStepStatus
- type RunStepToolCall
- type RunStepToolCallClassification
- type RunStepToolCallDetails
- type RunStepType
- type RunStepsPage
- type ServiceAPIVersions
- type SubmitToolOutputsAction
- type SubmitToolOutputsDetails
- type SubmitToolOutputsToRunBody
- type SubmitToolOutputsToRunOptions
- type SubmitToolOutputsToRunResponse
- type ThreadDeletionStatus
- type ThreadInitializationMessage
- type ThreadMessage
- type ThreadRun
- type ThreadRunLastError
- type ThreadRunsPage
- type ToolDefinition
- type ToolDefinitionClassification
- type ToolOutput
- type UpdateAssistantBody
- type UpdateAssistantOptions
- type UpdateAssistantResponse
- type UpdateMessageBody
- type UpdateMessageOptions
- type UpdateMessageResponse
- type UpdateRunBody
- type UpdateRunOptions
- type UpdateRunResponse
- type UpdateThreadBody
- type UpdateThreadOptions
- type UpdateThreadResponse
- type UploadFileOptions
- type UploadFileResponse
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Assistant ¶
type Assistant struct { // REQUIRED; The Unix timestamp, in seconds, representing when this object was created. CreatedAt *time.Time // REQUIRED; The description of the assistant. Description *string // REQUIRED; A list of attached file IDs, ordered by creation date in ascending order. FileIDs []string // REQUIRED; The identifier, which can be referenced in API endpoints. ID *string // REQUIRED; The system instructions for the assistant to use. Instructions *string // REQUIRED; A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information // about that object in a structured format. Keys may be up to 64 characters in length and // values may be up to 512 characters in length. Metadata map[string]*string // REQUIRED; The ID of the model to use. DeploymentName *string // REQUIRED; The name of the assistant. Name *string // REQUIRED; The object type, which is always assistant. Object *string // REQUIRED; The collection of tools enabled for the assistant. Tools []ToolDefinitionClassification }
Assistant - Represents an assistant that can call the model and use tools.
func (Assistant) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Assistant.
func (*Assistant) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type Assistant.
type AssistantCreationBody ¶
type AssistantCreationBody struct { // REQUIRED; The ID of the model to use. DeploymentName *string // The description of the new assistant. Description *string // A list of previously uploaded file IDs to attach to the assistant. FileIDs []string // The system instructions for the new assistant to use. Instructions *string // A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that // object in a structured format. Keys may be up to 64 characters in length and // values may be up to 512 characters in length. Metadata map[string]*string // The name of the new assistant. Name *string // The collection of tools to enable for the new assistant. Tools []ToolDefinitionClassification }
AssistantCreationBody - The request details to use when creating a new assistant.
func (AssistantCreationBody) MarshalJSON ¶
func (a AssistantCreationBody) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AssistantCreationBody.
func (*AssistantCreationBody) UnmarshalJSON ¶
func (a *AssistantCreationBody) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AssistantCreationBody.
type AssistantDeletionStatus ¶
type AssistantDeletionStatus struct { // REQUIRED; A value indicating whether deletion was successful. Deleted *bool // REQUIRED; The ID of the resource specified for deletion. ID *string // REQUIRED; The object type, which is always 'assistant.deleted'. Object *string }
AssistantDeletionStatus - The status of an assistant deletion operation.
func (AssistantDeletionStatus) MarshalJSON ¶
func (a AssistantDeletionStatus) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AssistantDeletionStatus.
func (*AssistantDeletionStatus) UnmarshalJSON ¶
func (a *AssistantDeletionStatus) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AssistantDeletionStatus.
type AssistantFile ¶
type AssistantFile struct { // REQUIRED; The assistant ID that the file is attached to. AssistantID *string // REQUIRED; The Unix timestamp, in seconds, representing when this object was created. CreatedAt *time.Time // REQUIRED; The identifier, which can be referenced in API endpoints. ID *string // REQUIRED; The object type, which is always 'assistant.file'. Object *string }
AssistantFile - Information about a file attached to an assistant, as used by tools that can read files.
func (AssistantFile) MarshalJSON ¶
func (a AssistantFile) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AssistantFile.
func (*AssistantFile) UnmarshalJSON ¶
func (a *AssistantFile) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AssistantFile.
type AssistantFileDeletionStatus ¶
type AssistantFileDeletionStatus struct { // REQUIRED; A value indicating whether deletion was successful. Deleted *bool // REQUIRED; The ID of the resource specified for deletion. ID *string // REQUIRED; The object type, which is always 'assistant.file.deleted'. Object *string }
AssistantFileDeletionStatus - The status of an assistant file deletion operation.
func (AssistantFileDeletionStatus) MarshalJSON ¶
func (a AssistantFileDeletionStatus) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AssistantFileDeletionStatus.
func (*AssistantFileDeletionStatus) UnmarshalJSON ¶
func (a *AssistantFileDeletionStatus) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AssistantFileDeletionStatus.
type AssistantFilesPage ¶
type AssistantFilesPage struct { // REQUIRED; The requested list of items. Data []AssistantFile // REQUIRED; The first ID represented in this list. FirstID *string // REQUIRED; A value indicating whether there are additional values available not captured in this list. HasMore *bool // REQUIRED; The last ID represented in this list. LastID *string // REQUIRED; The object type, which is always list. Object *string }
AssistantFilesPage - The response data for a requested list of items.
func (AssistantFilesPage) MarshalJSON ¶
func (p AssistantFilesPage) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AssistantFilesPage.
func (*AssistantFilesPage) UnmarshalJSON ¶
func (p *AssistantFilesPage) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AssistantFilesPage.
type AssistantThread ¶
type AssistantThread struct { // REQUIRED; The Unix timestamp, in seconds, representing when this object was created. CreatedAt *time.Time // REQUIRED; The identifier, which can be referenced in API endpoints. ID *string // REQUIRED; A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information // about that object in a structured format. Keys may be up to 64 characters in length and // values may be up to 512 characters in length. Metadata map[string]*string // REQUIRED; The object type, which is always 'thread'. Object *string }
AssistantThread - Information about a single thread associated with an assistant.
func (AssistantThread) MarshalJSON ¶
func (a AssistantThread) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AssistantThread.
func (*AssistantThread) UnmarshalJSON ¶
func (a *AssistantThread) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AssistantThread.
type AssistantThreadCreationOptions ¶
type AssistantThreadCreationOptions struct { // The initial messages to associate with the new thread. Messages []ThreadInitializationMessage // A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that // object in a structured format. Keys may be up to 64 characters in length and // values may be up to 512 characters in length. Metadata map[string]*string }
AssistantThreadCreationOptions - The details used to create a new assistant thread.
func (AssistantThreadCreationOptions) MarshalJSON ¶
func (a AssistantThreadCreationOptions) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AssistantThreadCreationOptions.
func (*AssistantThreadCreationOptions) UnmarshalJSON ¶
func (a *AssistantThreadCreationOptions) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AssistantThreadCreationOptions.
type AssistantsPage ¶
type AssistantsPage struct { // REQUIRED; The requested list of items. Data []Assistant // REQUIRED; The first ID represented in this list. FirstID *string // REQUIRED; A value indicating whether there are additional values available not captured in this list. HasMore *bool // REQUIRED; The last ID represented in this list. LastID *string // REQUIRED; The object type, which is always list. Object *string }
AssistantsPage - The response data for a requested list of items.
func (AssistantsPage) MarshalJSON ¶
func (p AssistantsPage) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type AssistantsPage.
func (*AssistantsPage) UnmarshalJSON ¶
func (p *AssistantsPage) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type AssistantsPage.
type CancelRunOptions ¶
type CancelRunOptions struct { }
CancelRunOptions contains the optional parameters for the Client.CancelRun method.
type CancelRunResponse ¶
type CancelRunResponse struct { // Data representing a single evaluation run of an assistant thread. ThreadRun }
CancelRunResponse contains the response from method Client.CancelRun.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client contains the methods for the OpenAIAssistants group. Don't use this type directly, use a constructor function instead.
func NewClient ¶
func NewClient(endpoint string, credential azcore.TokenCredential, options *ClientOptions) (*Client, error)
NewClient creates a new instance of Client that connects to an Azure OpenAI endpoint.
- endpoint - Azure OpenAI service endpoint, for example: https://{your-resource-name}.openai.azure.com
- credential - used to authorize requests. Usually a credential from github.com/Azure/azure-sdk-for-go/sdk/azidentity.
- options - client options, pass nil to accept the default values.
Example ¶
package main import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/ai/azopenaiassistants" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" ) func main() { dac, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { // TODO: Update the following line with your application specific error handling logic log.Fatalf("ERROR: %s", err) } // NOTE: this constructor creates a client that connects to an Azure OpenAI endpoint. // To connect to the public OpenAI endpoint, use azopenaiassistants.NewClientForOpenAI client, err := azopenaiassistants.NewClient("https://<your-azure-openai-host>.openai.azure.com", dac, nil) if err != nil { // TODO: Update the following line with your application specific error handling logic log.Fatalf("ERROR: %s", err) } _ = client }
Output:
func NewClientForOpenAI ¶
func NewClientForOpenAI(endpoint string, credential *azcore.KeyCredential, options *ClientOptions) (*Client, error)
NewClientForOpenAI creates a new instance of Client which connects to the public OpenAI endpoint.
- endpoint - OpenAI service endpoint, for example: https://api.openai.com/v1
- credential - used to authorize requests with an API Key credential
- options - client options, pass nil to accept the default values.
Example ¶
package main import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/ai/azopenaiassistants" "github.com/Azure/azure-sdk-for-go/sdk/azcore" ) func main() { keyCredential := azcore.NewKeyCredential("<OpenAI-APIKey>") // NOTE: this constructor creates a client that connects to the public OpenAI endpoint. // To connect to an Azure OpenAI endpoint, use azopenaiassistants.NewClient() or azopenaiassistants.NewClientWithyKeyCredential. client, err := azopenaiassistants.NewClientForOpenAI("https://api.openai.com/v1", keyCredential, nil) if err != nil { // TODO: Update the following line with your application specific error handling logic log.Fatalf("ERROR: %s", err) } _ = client }
Output:
func NewClientWithKeyCredential ¶
func NewClientWithKeyCredential(endpoint string, credential *azcore.KeyCredential, options *ClientOptions) (*Client, error)
NewClientWithKeyCredential creates a new instance of Client that connects to an Azure OpenAI endpoint.
- endpoint - Azure OpenAI service endpoint, for example: https://{your-resource-name}.openai.azure.com
- credential - used to authorize requests with an API Key credential
- options - client options, pass nil to accept the default values.
Example ¶
package main import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/ai/azopenaiassistants" "github.com/Azure/azure-sdk-for-go/sdk/azcore" ) func main() { keyCredential := azcore.NewKeyCredential("<Azure-OpenAI-APIKey>") // NOTE: this constructor creates a client that connects to an Azure OpenAI endpoint. // To connect to the public OpenAI endpoint, use azopenaiassistants.NewClientForOpenAI client, err := azopenaiassistants.NewClientWithKeyCredential("https://<your-azure-openai-host>.openai.azure.com", keyCredential, nil) if err != nil { // TODO: Update the following line with your application specific error handling logic log.Fatalf("ERROR: %s", err) } _ = client }
Output:
func (*Client) CancelRun ¶
func (client *Client) CancelRun(ctx context.Context, threadID string, runID string, options *CancelRunOptions) (CancelRunResponse, error)
CancelRun - Cancels a run of an in progress thread. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-02-15-preview
- threadID - The ID of the thread being run.
- runID - The ID of the run to cancel.
- options - CancelRunOptions contains the optional parameters for the Client.CancelRun method.
func (*Client) CreateAssistant ¶
func (client *Client) CreateAssistant(ctx context.Context, body AssistantCreationBody, options *CreateAssistantOptions) (CreateAssistantResponse, error)
CreateAssistant - Creates a new assistant. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-02-15-preview
- options - CreateAssistantOptions contains the optional parameters for the Client.CreateAssistant method.
func (*Client) CreateAssistantFile ¶
func (client *Client) CreateAssistantFile(ctx context.Context, assistantID string, body CreateAssistantFileBody, options *CreateAssistantFileOptions) (CreateAssistantFileResponse, error)
CreateAssistantFile - Attaches a previously uploaded file to an assistant for use by tools that can read files. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-02-15-preview
- assistantID - The ID of the assistant to attach the file to.
- options - CreateAssistantFileOptions contains the optional parameters for the Client.CreateAssistantFile method.
func (*Client) CreateMessage ¶
func (client *Client) CreateMessage(ctx context.Context, threadID string, body CreateMessageBody, options *CreateMessageOptions) (CreateMessageResponse, error)
CreateMessage - Creates a new message on a specified thread. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-02-15-preview
- threadID - The ID of the thread to create the new message on.
- options - CreateMessageOptions contains the optional parameters for the Client.CreateMessage method.
func (*Client) CreateRun ¶
func (client *Client) CreateRun(ctx context.Context, threadID string, body CreateRunBody, options *CreateRunOptions) (CreateRunResponse, error)
CreateRun - Creates a new run for an assistant thread. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-02-15-preview
- threadID - The ID of the thread to run.
- createRunOptions - The details for the run to create.
- options - CreateRunOptions contains the optional parameters for the Client.CreateRun method.
func (*Client) CreateThread ¶
func (client *Client) CreateThread(ctx context.Context, body AssistantThreadCreationOptions, options *CreateThreadOptions) (CreateThreadResponse, error)
CreateThread - Creates a new thread. Threads contain messages and can be run by assistants. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-02-15-preview
- options - CreateThreadOptions contains the optional parameters for the Client.CreateThread method.
func (*Client) CreateThreadAndRun ¶
func (client *Client) CreateThreadAndRun(ctx context.Context, body CreateAndRunThreadOptions, options *CreateThreadAndRunOptions) (CreateThreadAndRunResponse, error)
CreateThreadAndRun - Creates a new assistant thread and immediately starts a run using that new thread. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-02-15-preview
- options - CreateThreadAndRunOptions contains the optional parameters for the Client.CreateThreadAndRun method.
func (*Client) DeleteAssistant ¶
func (client *Client) DeleteAssistant(ctx context.Context, assistantID string, options *DeleteAssistantOptions) (DeleteAssistantResponse, error)
DeleteAssistant - Deletes an assistant. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-02-15-preview
- assistantID - The ID of the assistant to delete.
- options - DeleteAssistantOptions contains the optional parameters for the Client.DeleteAssistant method.
func (*Client) DeleteAssistantFile ¶
func (client *Client) DeleteAssistantFile(ctx context.Context, assistantID string, fileID string, options *DeleteAssistantFileOptions) (DeleteAssistantFileResponse, error)
DeleteAssistantFile - Unlinks a previously attached file from an assistant, rendering it unavailable for use by tools that can read files. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-02-15-preview
- assistantID - The ID of the assistant from which the specified file should be unlinked.
- fileID - The ID of the file to unlink from the specified assistant.
- options - DeleteAssistantFileOptions contains the optional parameters for the Client.DeleteAssistantFile method.
func (*Client) DeleteFile ¶
func (client *Client) DeleteFile(ctx context.Context, fileID string, options *DeleteFileOptions) (DeleteFileResponse, error)
DeleteFile - Delete a previously uploaded file. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-02-15-preview
- fileID - The ID of the file to delete.
- options - DeleteFileOptions contains the optional parameters for the Client.DeleteFile method.
func (*Client) DeleteThread ¶
func (client *Client) DeleteThread(ctx context.Context, threadID string, options *DeleteThreadOptions) (DeleteThreadResponse, error)
DeleteThread - Deletes an existing thread. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-02-15-preview
- threadID - The ID of the thread to delete.
- options - DeleteThreadOptions contains the optional parameters for the Client.DeleteThread method.
func (*Client) GetAssistant ¶
func (client *Client) GetAssistant(ctx context.Context, assistantID string, options *GetAssistantOptions) (GetAssistantResponse, error)
GetAssistant - Retrieves an existing assistant. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-02-15-preview
- assistantID - The ID of the assistant to retrieve.
- options - GetAssistantOptions contains the optional parameters for the Client.GetAssistant method.
func (*Client) GetAssistantFile ¶
func (client *Client) GetAssistantFile(ctx context.Context, assistantID string, fileID string, options *GetAssistantFileOptions) (GetAssistantFileResponse, error)
GetAssistantFile - Retrieves a file attached to an assistant. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-02-15-preview
- assistantID - The ID of the assistant associated with the attached file.
- fileID - The ID of the file to retrieve.
- options - GetAssistantFileOptions contains the optional parameters for the Client.GetAssistantFile method.
func (*Client) GetFile ¶
func (client *Client) GetFile(ctx context.Context, fileID string, options *GetFileOptions) (GetFileResponse, error)
GetFile - Returns information about a specific file. Does not retrieve file content. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-02-15-preview
- fileID - The ID of the file to retrieve.
- options - GetFileOptions contains the optional parameters for the Client.GetFile method.
func (*Client) GetFileContent ¶
func (client *Client) GetFileContent(ctx context.Context, fileID string, options *GetFileContentOptions) (GetFileContentResponse, error)
GetFileContent - Returns content for a specific file. If the operation fails it returns an *azcore.ResponseError type.
- fileID - The ID of the file to retrieve.
- options - GetFileContentOptions contains the optional parameters for the Client.GetFileContent method.
func (*Client) GetMessage ¶
func (client *Client) GetMessage(ctx context.Context, threadID string, messageID string, options *GetMessageOptions) (GetMessageResponse, error)
GetMessage - Gets an existing message from an existing thread. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-02-15-preview
- threadID - The ID of the thread to retrieve the specified message from.
- messageID - The ID of the message to retrieve from the specified thread.
- options - GetMessageOptions contains the optional parameters for the Client.GetMessage method.
func (*Client) GetMessageFile ¶
func (client *Client) GetMessageFile(ctx context.Context, threadID string, messageID string, fileID string, options *GetMessageFileOptions) (GetMessageFileResponse, error)
GetMessageFile - Gets information about a file attachment to a message within a thread. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-02-15-preview
- threadID - The ID of the thread containing the message to get information from.
- messageID - The ID of the message to get information from.
- fileID - The ID of the file to get information about.
- options - GetMessageFileOptions contains the optional parameters for the Client.GetMessageFile method.
func (*Client) GetRun ¶
func (client *Client) GetRun(ctx context.Context, threadID string, runID string, options *GetRunOptions) (GetRunResponse, error)
GetRun - Gets an existing run from an existing thread. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-02-15-preview
- threadID - The ID of the thread to retrieve run information from.
- runID - The ID of the thread to retrieve information about.
- options - GetRunOptions contains the optional parameters for the Client.GetRun method.
func (*Client) GetRunStep ¶
func (client *Client) GetRunStep(ctx context.Context, threadID string, runID string, stepID string, options *GetRunStepOptions) (GetRunStepResponse, error)
GetRunStep - Gets a single run step from a thread run. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-02-15-preview
- threadID - The ID of the thread that was run.
- runID - The ID of the specific run to retrieve the step from.
- stepID - The ID of the step to retrieve information about.
- options - GetRunStepOptions contains the optional parameters for the Client.GetRunStep method.
func (*Client) GetThread ¶
func (client *Client) GetThread(ctx context.Context, threadID string, options *GetThreadOptions) (GetThreadResponse, error)
GetThread - Gets information about an existing thread. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-02-15-preview
- threadID - The ID of the thread to retrieve information about.
- options - GetThreadOptions contains the optional parameters for the Client.GetThread method.
func (*Client) ListFiles ¶
func (client *Client) ListFiles(ctx context.Context, options *ListFilesOptions) (ListFilesResponse, error)
ListFiles - Gets a list of previously uploaded files. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-02-15-preview
- options - ListFilesOptions contains the optional parameters for the Client.ListFiles method.
func (*Client) NewListAssistantFilesPager ¶
func (c *Client) NewListAssistantFilesPager(assistantID string, options *ListAssistantFilesOptions) *runtime.Pager[ListAssistantFilesResponse]
NewListAssistantFilesPager returns a pager for an assistant's files.
func (*Client) NewListAssistantsPager ¶
func (c *Client) NewListAssistantsPager(options *ListAssistantsOptions) *runtime.Pager[ListAssistantsResponse]
NewListAssistantsPager returns a pager for assistants.
func (*Client) NewListMessageFilesPager ¶
func (c *Client) NewListMessageFilesPager(threadID string, messageID string, options *ListMessageFilesOptions) *runtime.Pager[ListMessageFilesResponse]
NewListMessageFilesPager returns a pager for a message's files.
func (*Client) NewListMessagesPager ¶
func (c *Client) NewListMessagesPager(threadID string, options *ListMessagesOptions) *runtime.Pager[ListMessagesResponse]
NewListMessagesPager returns a pager for messages associated with a thread.
func (*Client) NewListRunStepsPager ¶
func (c *Client) NewListRunStepsPager(threadID string, runID string, options *ListRunStepsOptions) *runtime.Pager[ListRunStepsResponse]
NewListRunStepsPager returns a pager for a Run's steps.
func (*Client) NewListRunsPager ¶
func (c *Client) NewListRunsPager(threadID string, options *ListRunsOptions) *runtime.Pager[ListRunsResponse]
NewListRunsPager returns a pager for a Thread's runs.
func (*Client) SubmitToolOutputsToRun ¶
func (client *Client) SubmitToolOutputsToRun(ctx context.Context, threadID string, runID string, body SubmitToolOutputsToRunBody, options *SubmitToolOutputsToRunOptions) (SubmitToolOutputsToRunResponse, error)
SubmitToolOutputsToRun - Submits outputs from tools as requested by tool calls in a run. Runs that need submitted tool outputs will have a status of 'requiresaction' with a requiredaction.type of 'submittooloutputs'. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-02-15-preview
- threadID - The ID of the thread that was run.
- runID - The ID of the run that requires tool outputs.
- options - SubmitToolOutputsToRunOptions contains the optional parameters for the Client.SubmitToolOutputsToRun method.
func (*Client) UpdateAssistant ¶
func (client *Client) UpdateAssistant(ctx context.Context, assistantID string, body UpdateAssistantOptions, options *UpdateAssistantOptions) (UpdateAssistantResponse, error)
UpdateAssistant - Modifies an existing assistant. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-02-15-preview
- assistantID - The ID of the assistant to modify.
- options - UpdateAssistantOptions contains the optional parameters for the Client.UpdateAssistant method.
func (*Client) UpdateMessage ¶
func (client *Client) UpdateMessage(ctx context.Context, threadID string, messageID string, body UpdateMessageBody, options *UpdateMessageOptions) (UpdateMessageResponse, error)
UpdateMessage - Modifies an existing message on an existing thread. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-02-15-preview
- threadID - The ID of the thread containing the specified message to modify.
- messageID - The ID of the message to modify on the specified thread.
- options - UpdateMessageOptions contains the optional parameters for the Client.UpdateMessage method.
func (*Client) UpdateRun ¶
func (client *Client) UpdateRun(ctx context.Context, threadID string, runID string, body UpdateRunBody, options *UpdateRunOptions) (UpdateRunResponse, error)
UpdateRun - Modifies an existing thread run. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-02-15-preview
- threadID - The ID of the thread associated with the specified run.
- runID - The ID of the run to modify.
- options - UpdateRunOptions contains the optional parameters for the Client.UpdateRun method.
func (*Client) UpdateThread ¶
func (client *Client) UpdateThread(ctx context.Context, threadID string, body UpdateThreadBody, options *UpdateThreadOptions) (UpdateThreadResponse, error)
UpdateThread - Modifies an existing thread. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-02-15-preview
- threadID - The ID of the thread to modify.
- options - UpdateThreadOptions contains the optional parameters for the Client.UpdateThread method.
func (*Client) UploadFile ¶
func (client *Client) UploadFile(ctx context.Context, file io.ReadSeeker, purpose FilePurpose, options *UploadFileOptions) (UploadFileResponse, error)
UploadFile - Uploads a file for use by other operations. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-02-15-preview
- file - The file data (not filename) to upload.
- purpose - The intended purpose of the file.
- options - UploadFileOptions contains the optional parameters for the Client.UploadFile method.
type ClientOptions ¶
type ClientOptions struct {
azcore.ClientOptions
}
ClientOptions contains optional settings for Client.
type CodeInterpreterToolDefinition ¶
type CodeInterpreterToolDefinition struct { // REQUIRED; The object type. Type *string }
CodeInterpreterToolDefinition - The input definition information for a code interpreter tool as used to configure an assistant.
func (*CodeInterpreterToolDefinition) GetToolDefinition ¶
func (c *CodeInterpreterToolDefinition) GetToolDefinition() *ToolDefinition
GetToolDefinition implements the ToolDefinitionClassification interface for type CodeInterpreterToolDefinition.
func (CodeInterpreterToolDefinition) MarshalJSON ¶
func (c CodeInterpreterToolDefinition) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CodeInterpreterToolDefinition.
func (*CodeInterpreterToolDefinition) UnmarshalJSON ¶
func (c *CodeInterpreterToolDefinition) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CodeInterpreterToolDefinition.
type CreateAndRunThreadOptions ¶
type CreateAndRunThreadOptions struct { // REQUIRED; The ID of the assistant for which the thread should be created. AssistantID *string // The overridden system instructions the assistant should use to run the thread. Instructions *string // A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that // object in a structured format. Keys may be up to 64 characters in length and // values may be up to 512 characters in length. Metadata map[string]*string // The overridden model that the assistant should use to run the thread. DeploymentName *string // The details used to create the new thread. Thread *AssistantThreadCreationOptions // The overridden list of enabled tools the assistant should use to run the thread. Tools []ToolDefinitionClassification }
CreateAndRunThreadOptions - The details used when creating and immediately running a new assistant thread.
func (CreateAndRunThreadOptions) MarshalJSON ¶
func (c CreateAndRunThreadOptions) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CreateAndRunThreadOptions.
func (*CreateAndRunThreadOptions) UnmarshalJSON ¶
func (c *CreateAndRunThreadOptions) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CreateAndRunThreadOptions.
type CreateAssistantFileBody ¶
type CreateAssistantFileBody struct { // REQUIRED; The ID of the previously uploaded file to attach. FileID *string }
CreateAssistantFileBody - The request details to use when creating an assistant file.
func (CreateAssistantFileBody) MarshalJSON ¶
func (p CreateAssistantFileBody) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CreateAssistantFileBody.
func (*CreateAssistantFileBody) UnmarshalJSON ¶
func (p *CreateAssistantFileBody) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CreateAssistantFileBody.
type CreateAssistantFileOptions ¶
type CreateAssistantFileOptions struct { }
CreateAssistantFileOptions contains the optional parameters for the Client.CreateAssistantFile method.
type CreateAssistantFileResponse ¶
type CreateAssistantFileResponse struct { // Information about a file attached to an assistant, as used by tools that can read files. AssistantFile }
CreateAssistantFileResponse contains the response from method Client.CreateAssistantFile.
type CreateAssistantOptions ¶
type CreateAssistantOptions struct { }
CreateAssistantOptions contains the optional parameters for the Client.CreateAssistant method.
type CreateAssistantResponse ¶
type CreateAssistantResponse struct { // Represents an assistant that can call the model and use tools. Assistant }
CreateAssistantResponse contains the response from method Client.CreateAssistant.
type CreateMessageBody ¶
type CreateMessageBody struct { // REQUIRED; The textual content for the new message. Content *string // REQUIRED; The role to associate with the new message. Role *MessageRole // A list of up to 10 file IDs to associate with the message, as used by tools like 'code_interpreter' or 'retrieval' that // can read files. FileIDs []string // A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that // object in a structured format. Keys may be up to 64 characters in length and // values may be up to 512 characters in length. Metadata map[string]*string }
CreateMessageBody - The request details to use when creating a message.
func (CreateMessageBody) MarshalJSON ¶
func (p CreateMessageBody) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CreateMessageBody.
func (*CreateMessageBody) UnmarshalJSON ¶
func (p *CreateMessageBody) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CreateMessageBody.
type CreateMessageOptions ¶
type CreateMessageOptions struct { }
CreateMessageOptions contains the optional parameters for the Client.CreateMessage method.
type CreateMessageResponse ¶
type CreateMessageResponse struct { // A single, existing message within an assistant thread. ThreadMessage }
CreateMessageResponse contains the response from method Client.CreateMessage.
type CreateRunBody ¶
type CreateRunBody struct { // REQUIRED; The ID of the assistant that should run the thread. AssistantID *string // Additional instructions to append at the end of the instructions for the run. This is useful for modifying the behavior // on a per-run basis without overriding other instructions. AdditionalInstructions *string // The overridden system instructions that the assistant should use to run the thread. Instructions *string // A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that // object in a structured format. Keys may be up to 64 characters in length and // values may be up to 512 characters in length. Metadata map[string]*string // The overridden model name that the assistant should use to run the thread. DeploymentName *string // The overridden list of enabled tools that the assistant should use to run the thread. Tools []ToolDefinitionClassification }
CreateRunBody - The details used when creating a new run of an assistant thread.
func (CreateRunBody) MarshalJSON ¶
func (c CreateRunBody) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CreateRunBody.
func (*CreateRunBody) UnmarshalJSON ¶
func (c *CreateRunBody) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CreateRunBody.
type CreateRunOptions ¶
type CreateRunOptions struct { }
CreateRunOptions contains the optional parameters for the Client.CreateRun method.
type CreateRunResponse ¶
type CreateRunResponse struct { // Data representing a single evaluation run of an assistant thread. ThreadRun }
CreateRunResponse contains the response from method Client.CreateRun.
type CreateThreadAndRunOptions ¶
type CreateThreadAndRunOptions struct { }
CreateThreadAndRunOptions contains the optional parameters for the Client.CreateThreadAndRun method.
type CreateThreadAndRunResponse ¶
type CreateThreadAndRunResponse struct { // Data representing a single evaluation run of an assistant thread. ThreadRun }
CreateThreadAndRunResponse contains the response from method Client.CreateThreadAndRun.
type CreateThreadOptions ¶
type CreateThreadOptions struct { }
CreateThreadOptions contains the optional parameters for the Client.CreateThread method.
type CreateThreadResponse ¶
type CreateThreadResponse struct { // Information about a single thread associated with an assistant. AssistantThread }
CreateThreadResponse contains the response from method Client.CreateThread.
type DeleteAssistantFileOptions ¶
type DeleteAssistantFileOptions struct { }
DeleteAssistantFileOptions contains the optional parameters for the Client.DeleteAssistantFile method.
type DeleteAssistantFileResponse ¶
type DeleteAssistantFileResponse struct { // The status of an assistant file deletion operation. AssistantFileDeletionStatus }
DeleteAssistantFileResponse contains the response from method Client.DeleteAssistantFile.
type DeleteAssistantOptions ¶
type DeleteAssistantOptions struct { }
DeleteAssistantOptions contains the optional parameters for the Client.DeleteAssistant method.
type DeleteAssistantResponse ¶
type DeleteAssistantResponse struct { // The status of an assistant deletion operation. AssistantDeletionStatus }
DeleteAssistantResponse contains the response from method Client.DeleteAssistant.
type DeleteFileOptions ¶
type DeleteFileOptions struct { }
DeleteFileOptions contains the optional parameters for the Client.DeleteFile method.
type DeleteFileResponse ¶
type DeleteFileResponse struct { // A status response from a file deletion operation. FileDeletionStatus }
DeleteFileResponse contains the response from method Client.DeleteFile.
type DeleteThreadOptions ¶
type DeleteThreadOptions struct { }
DeleteThreadOptions contains the optional parameters for the Client.DeleteThread method.
type DeleteThreadResponse ¶
type DeleteThreadResponse struct { // The status of a thread deletion operation. ThreadDeletionStatus }
DeleteThreadResponse contains the response from method Client.DeleteThread.
type FileDeletionStatus ¶
type FileDeletionStatus struct { // REQUIRED; A value indicating whether deletion was successful. Deleted *bool // REQUIRED; The ID of the resource specified for deletion. ID *string // REQUIRED; The object type, which is always 'file'. Object *string }
FileDeletionStatus - A status response from a file deletion operation.
func (FileDeletionStatus) MarshalJSON ¶
func (f FileDeletionStatus) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type FileDeletionStatus.
func (*FileDeletionStatus) UnmarshalJSON ¶
func (f *FileDeletionStatus) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type FileDeletionStatus.
type FileListResponse ¶
type FileListResponse struct { // REQUIRED; The files returned for the request. Data []OpenAIFile // REQUIRED; The object type, which is always 'list'. Object *string }
FileListResponse - The response data from a file list operation.
func (FileListResponse) MarshalJSON ¶
func (f FileListResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type FileListResponse.
func (*FileListResponse) UnmarshalJSON ¶
func (f *FileListResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type FileListResponse.
type FilePurpose ¶
type FilePurpose string
FilePurpose - The possible values denoting the intended usage of a file.
const ( // FilePurposeAssistants - Indicates a file is used as input to assistants. FilePurposeAssistants FilePurpose = "assistants" // FilePurposeAssistantsOutput - Indicates a file is used as output by assistants. FilePurposeAssistantsOutput FilePurpose = "assistants_output" // FilePurposeFineTune - Indicates a file is used for fine tuning input. FilePurposeFineTune FilePurpose = "fine-tune" // FilePurposeFineTuneResults - Indicates a file is used for fine tuning results. FilePurposeFineTuneResults FilePurpose = "fine-tune-results" )
func PossibleFilePurposeValues ¶
func PossibleFilePurposeValues() []FilePurpose
PossibleFilePurposeValues returns the possible values for the FilePurpose const type.
type FunctionDefinition ¶
type FunctionDefinition struct { // REQUIRED; The name of the function to be called. Name *string // REQUIRED; The parameters the functions accepts, described as a JSON Schema object. Parameters any // A description of what the function does, used by the model to choose when and how to call the function. Description *string }
FunctionDefinition - The input definition information for a function.
func (FunctionDefinition) MarshalJSON ¶
func (f FunctionDefinition) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type FunctionDefinition.
func (*FunctionDefinition) UnmarshalJSON ¶
func (f *FunctionDefinition) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type FunctionDefinition.
type FunctionToolDefinition ¶
type FunctionToolDefinition struct { // REQUIRED; The definition of the concrete function that the function tool should call. Function *FunctionDefinition // REQUIRED; The object type. Type *string }
FunctionToolDefinition - The input definition information for a function tool as used to configure an assistant.
func (*FunctionToolDefinition) GetToolDefinition ¶
func (f *FunctionToolDefinition) GetToolDefinition() *ToolDefinition
GetToolDefinition implements the ToolDefinitionClassification interface for type FunctionToolDefinition.
func (FunctionToolDefinition) MarshalJSON ¶
func (f FunctionToolDefinition) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type FunctionToolDefinition.
func (*FunctionToolDefinition) UnmarshalJSON ¶
func (f *FunctionToolDefinition) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type FunctionToolDefinition.
type GetAssistantFileOptions ¶
type GetAssistantFileOptions struct { }
GetAssistantFileOptions contains the optional parameters for the Client.GetAssistantFile method.
type GetAssistantFileResponse ¶
type GetAssistantFileResponse struct { // Information about a file attached to an assistant, as used by tools that can read files. AssistantFile }
GetAssistantFileResponse contains the response from method Client.GetAssistantFile.
type GetAssistantOptions ¶
type GetAssistantOptions struct { }
GetAssistantOptions contains the optional parameters for the Client.GetAssistant method.
type GetAssistantResponse ¶
type GetAssistantResponse struct { // Represents an assistant that can call the model and use tools. Assistant }
GetAssistantResponse contains the response from method Client.GetAssistant.
type GetFileContentOptions ¶
type GetFileContentOptions struct { }
GetFileContentOptions contains the options for the Client.GetFileContent function.
type GetFileContentResponse ¶
type GetFileContentResponse struct { // Content is the content of the file that's been downloaded. // NOTE: this must be Close()'d to avoid leaking resources. Content io.ReadCloser }
GetFileContentResponse contains the response from the Client.GetFileContent function.
type GetFileOptions ¶
type GetFileOptions struct { }
GetFileOptions contains the optional parameters for the Client.GetFile method.
type GetFileResponse ¶
type GetFileResponse struct { // Represents an assistant that can call the model and use tools. OpenAIFile }
GetFileResponse contains the response from method Client.GetFile.
type GetMessageFileOptions ¶
type GetMessageFileOptions struct { }
GetMessageFileOptions contains the optional parameters for the Client.GetMessageFile method.
type GetMessageFileResponse ¶
type GetMessageFileResponse struct { // Information about a file attached to an assistant thread message. MessageFile }
GetMessageFileResponse contains the response from method Client.GetMessageFile.
type GetMessageOptions ¶
type GetMessageOptions struct { }
GetMessageOptions contains the optional parameters for the Client.GetMessage method.
type GetMessageResponse ¶
type GetMessageResponse struct { // A single, existing message within an assistant thread. ThreadMessage }
GetMessageResponse contains the response from method Client.GetMessage.
type GetRunOptions ¶
type GetRunOptions struct { }
GetRunOptions contains the optional parameters for the Client.GetRun method.
type GetRunResponse ¶
type GetRunResponse struct { // Data representing a single evaluation run of an assistant thread. ThreadRun }
GetRunResponse contains the response from method Client.GetRun.
type GetRunStepOptions ¶
type GetRunStepOptions struct { }
GetRunStepOptions contains the optional parameters for the Client.GetRunStep method.
type GetRunStepResponse ¶
type GetRunStepResponse struct { // Detailed information about a single step of an assistant thread run. RunStep }
GetRunStepResponse contains the response from method Client.GetRunStep.
type GetThreadOptions ¶
type GetThreadOptions struct { }
GetThreadOptions contains the optional parameters for the Client.GetThread method.
type GetThreadResponse ¶
type GetThreadResponse struct { // Information about a single thread associated with an assistant. AssistantThread }
GetThreadResponse contains the response from method Client.GetThread.
type ListAssistantFilesOptions ¶
type ListAssistantFilesOptions struct { // A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a // list request and receive 100 objects, ending with objfoo, your subsequent call // can include after=objfoo in order to fetch the next page of the list. After *string // A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a // list request and receive 100 objects, ending with objfoo, your subsequent call // can include before=objfoo in order to fetch the previous page of the list. Before *string // A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. Limit *int32 // Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order. Order *ListSortOrder }
ListAssistantFilesOptions contains the optional parameters for the Client.ListAssistantFiles method.
type ListAssistantFilesResponse ¶
type ListAssistantFilesResponse struct { // The response data for a requested list of items. AssistantFilesPage }
ListAssistantFilesResponse contains the response from method Client.ListAssistantFiles.
type ListAssistantsOptions ¶
type ListAssistantsOptions struct { // A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a // list request and receive 100 objects, ending with objfoo, your subsequent call // can include after=objfoo in order to fetch the next page of the list. After *string // A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a // list request and receive 100 objects, ending with objfoo, your subsequent call // can include before=objfoo in order to fetch the previous page of the list. Before *string // A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. Limit *int32 // Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order. Order *ListSortOrder }
ListAssistantsOptions contains the optional parameters for the Client.ListAssistants method.
type ListAssistantsResponse ¶
type ListAssistantsResponse struct { // The response data for a requested list of items. AssistantsPage }
ListAssistantsResponse contains the response from method Client.ListAssistants.
type ListFilesOptions ¶
type ListFilesOptions struct { // A value that, when provided, limits list results to files matching the corresponding purpose. Purpose *FilePurpose }
ListFilesOptions contains the optional parameters for the Client.ListFiles method.
type ListFilesResponse ¶
type ListFilesResponse struct { // The response data from a file list operation. FileListResponse }
ListFilesResponse contains the response from method Client.ListFiles.
type ListMessageFilesOptions ¶
type ListMessageFilesOptions struct { // A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a // list request and receive 100 objects, ending with objfoo, your subsequent call // can include after=objfoo in order to fetch the next page of the list. After *string // A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a // list request and receive 100 objects, ending with objfoo, your subsequent call // can include before=objfoo in order to fetch the previous page of the list. Before *string // A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. Limit *int32 // Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order. Order *ListSortOrder }
ListMessageFilesOptions contains the optional parameters for the Client.ListMessageFiles method.
type ListMessageFilesResponse ¶
type ListMessageFilesResponse struct { // The response data for a requested list of items. MessageFilesPage }
ListMessageFilesResponse contains the response from method Client.ListMessageFiles.
type ListMessagesOptions ¶
type ListMessagesOptions struct { // A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a // list request and receive 100 objects, ending with objfoo, your subsequent call // can include after=objfoo in order to fetch the next page of the list. After *string // A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a // list request and receive 100 objects, ending with objfoo, your subsequent call // can include before=objfoo in order to fetch the previous page of the list. Before *string // A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. Limit *int32 // Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order. Order *ListSortOrder }
ListMessagesOptions contains the optional parameters for the Client.ListMessages method.
type ListMessagesResponse ¶
type ListMessagesResponse struct { // The response data for a requested list of items. MessagesPage }
ListMessagesResponse contains the response from method Client.ListMessages.
type ListRunStepsOptions ¶
type ListRunStepsOptions struct { // A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a // list request and receive 100 objects, ending with objfoo, your subsequent call // can include after=objfoo in order to fetch the next page of the list. After *string // A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a // list request and receive 100 objects, ending with objfoo, your subsequent call // can include before=objfoo in order to fetch the previous page of the list. Before *string // A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. Limit *int32 // Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order. Order *ListSortOrder }
ListRunStepsOptions contains the optional parameters for the Client.ListRunSteps method.
type ListRunStepsResponse ¶
type ListRunStepsResponse struct { // The response data for a requested list of items. RunStepsPage }
ListRunStepsResponse contains the response from method Client.ListRunSteps.
type ListRunsOptions ¶
type ListRunsOptions struct { // A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a // list request and receive 100 objects, ending with objfoo, your subsequent call // can include after=objfoo in order to fetch the next page of the list. After *string // A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a // list request and receive 100 objects, ending with objfoo, your subsequent call // can include before=objfoo in order to fetch the previous page of the list. Before *string // A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. Limit *int32 // Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order. Order *ListSortOrder }
ListRunsOptions contains the optional parameters for the Client.ListRuns method.
type ListRunsResponse ¶
type ListRunsResponse struct { // The response data for a requested list of items. ThreadRunsPage }
ListRunsResponse contains the response from method Client.ListRuns.
type ListSortOrder ¶
type ListSortOrder string
ListSortOrder - The available sorting options when requesting a list of response objects.
const ( // ListSortOrderAscending - Specifies an ascending sort order. ListSortOrderAscending ListSortOrder = "asc" // ListSortOrderDescending - Specifies a descending sort order. ListSortOrderDescending ListSortOrder = "desc" )
func PossibleListSortOrderValues ¶
func PossibleListSortOrderValues() []ListSortOrder
PossibleListSortOrderValues returns the possible values for the ListSortOrder const type.
type MessageContent ¶
type MessageContent struct { // REQUIRED; The object type. Type *string }
MessageContent - An abstract representation of a single item of thread message content.
func (*MessageContent) GetMessageContent ¶
func (m *MessageContent) GetMessageContent() *MessageContent
GetMessageContent implements the MessageContentClassification interface for type MessageContent.
func (MessageContent) MarshalJSON ¶
func (m MessageContent) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MessageContent.
func (*MessageContent) UnmarshalJSON ¶
func (m *MessageContent) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MessageContent.
type MessageContentClassification ¶
type MessageContentClassification interface { // GetMessageContent returns the MessageContent content of the underlying type. GetMessageContent() *MessageContent }
MessageContentClassification provides polymorphic access to related types. Call the interface's GetMessageContent() method to access the common type. Use a type switch to determine the concrete type. The possible types are: - *MessageContent, *MessageImageFileContent, *MessageTextContent
type MessageFile ¶
type MessageFile struct { // REQUIRED; The Unix timestamp, in seconds, representing when this object was created. CreatedAt *time.Time // REQUIRED; The identifier, which can be referenced in API endpoints. ID *string // REQUIRED; The ID of the message that this file is attached to. MessageID *string // REQUIRED; The object type, which is always 'thread.message.file'. Object *string }
MessageFile - Information about a file attached to an assistant thread message.
func (MessageFile) MarshalJSON ¶
func (m MessageFile) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MessageFile.
func (*MessageFile) UnmarshalJSON ¶
func (m *MessageFile) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MessageFile.
type MessageFilesPage ¶
type MessageFilesPage struct { // REQUIRED; The requested list of items. Data []MessageFile // REQUIRED; The first ID represented in this list. FirstID *string // REQUIRED; A value indicating whether there are additional values available not captured in this list. HasMore *bool // REQUIRED; The last ID represented in this list. LastID *string // REQUIRED; The object type, which is always list. Object *string }
MessageFilesPage - The response data for a requested list of items.
func (MessageFilesPage) MarshalJSON ¶
func (p MessageFilesPage) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MessageFilesPage.
func (*MessageFilesPage) UnmarshalJSON ¶
func (p *MessageFilesPage) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MessageFilesPage.
type MessageImageFileContent ¶
type MessageImageFileContent struct { // REQUIRED; The image file for this thread message content item. ImageFile *MessageImageFileDetails // REQUIRED; The object type. Type *string }
MessageImageFileContent - A representation of image file content in a thread message.
func (*MessageImageFileContent) GetMessageContent ¶
func (m *MessageImageFileContent) GetMessageContent() *MessageContent
GetMessageContent implements the MessageContentClassification interface for type MessageImageFileContent.
func (MessageImageFileContent) MarshalJSON ¶
func (m MessageImageFileContent) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MessageImageFileContent.
func (*MessageImageFileContent) UnmarshalJSON ¶
func (m *MessageImageFileContent) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MessageImageFileContent.
type MessageImageFileDetails ¶
type MessageImageFileDetails struct { // REQUIRED; The ID for the file associated with this image. FileID *string }
MessageImageFileDetails - An image reference, as represented in thread message content.
func (MessageImageFileDetails) MarshalJSON ¶
func (m MessageImageFileDetails) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MessageImageFileDetails.
func (*MessageImageFileDetails) UnmarshalJSON ¶
func (m *MessageImageFileDetails) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MessageImageFileDetails.
type MessageRole ¶
type MessageRole string
MessageRole - The possible values for roles attributed to messages in a thread.
const ( // MessageRoleAssistant - The role representing the assistant. MessageRoleAssistant MessageRole = "assistant" // MessageRoleUser - The role representing the end-user. MessageRoleUser MessageRole = "user" )
func PossibleMessageRoleValues ¶
func PossibleMessageRoleValues() []MessageRole
PossibleMessageRoleValues returns the possible values for the MessageRole const type.
type MessageTextAnnotation ¶
type MessageTextAnnotation struct { // REQUIRED; The last text index associated with this text annotation. EndIndex *int32 // REQUIRED; The first text index associated with this text annotation. StartIndex *int32 // REQUIRED; The textual content associated with this text annotation item. Text *string // REQUIRED; The object type. Type *string }
MessageTextAnnotation - An abstract representation of an annotation to text thread message content.
func (*MessageTextAnnotation) GetMessageTextAnnotation ¶
func (m *MessageTextAnnotation) GetMessageTextAnnotation() *MessageTextAnnotation
GetMessageTextAnnotation implements the MessageTextAnnotationClassification interface for type MessageTextAnnotation.
func (MessageTextAnnotation) MarshalJSON ¶
func (m MessageTextAnnotation) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MessageTextAnnotation.
func (*MessageTextAnnotation) UnmarshalJSON ¶
func (m *MessageTextAnnotation) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MessageTextAnnotation.
type MessageTextAnnotationClassification ¶
type MessageTextAnnotationClassification interface { // GetMessageTextAnnotation returns the MessageTextAnnotation content of the underlying type. GetMessageTextAnnotation() *MessageTextAnnotation }
MessageTextAnnotationClassification provides polymorphic access to related types. Call the interface's GetMessageTextAnnotation() method to access the common type. Use a type switch to determine the concrete type. The possible types are: - *MessageTextAnnotation, *MessageTextFileCitationAnnotation, *MessageTextFilePathAnnotation
type MessageTextContent ¶
type MessageTextContent struct { // REQUIRED; The text and associated annotations for this thread message content item. Text *MessageTextDetails // REQUIRED; The object type. Type *string }
MessageTextContent - A representation of a textual item of thread message content.
func (*MessageTextContent) GetMessageContent ¶
func (m *MessageTextContent) GetMessageContent() *MessageContent
GetMessageContent implements the MessageContentClassification interface for type MessageTextContent.
func (MessageTextContent) MarshalJSON ¶
func (m MessageTextContent) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MessageTextContent.
func (*MessageTextContent) UnmarshalJSON ¶
func (m *MessageTextContent) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MessageTextContent.
type MessageTextDetails ¶
type MessageTextDetails struct { // REQUIRED; A list of annotations associated with this text. Annotations []MessageTextAnnotationClassification // REQUIRED; The text data. Value *string }
MessageTextDetails - The text and associated annotations for a single item of assistant thread message content.
func (MessageTextDetails) MarshalJSON ¶
func (m MessageTextDetails) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MessageTextDetails.
func (*MessageTextDetails) UnmarshalJSON ¶
func (m *MessageTextDetails) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MessageTextDetails.
type MessageTextFileCitationAnnotation ¶
type MessageTextFileCitationAnnotation struct { // REQUIRED; The last text index associated with this text annotation. EndIndex *int32 // REQUIRED; A citation within the message that points to a specific quote from a specific file. Generated when the assistant // uses the "retrieval" tool to search files. FileCitation *MessageTextFileCitationDetails // REQUIRED; The first text index associated with this text annotation. StartIndex *int32 // REQUIRED; The textual content associated with this text annotation item. Text *string // REQUIRED; The object type. Type *string }
MessageTextFileCitationAnnotation - A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the 'retrieval' tool to search files.
func (*MessageTextFileCitationAnnotation) GetMessageTextAnnotation ¶
func (m *MessageTextFileCitationAnnotation) GetMessageTextAnnotation() *MessageTextAnnotation
GetMessageTextAnnotation implements the MessageTextAnnotationClassification interface for type MessageTextFileCitationAnnotation.
func (MessageTextFileCitationAnnotation) MarshalJSON ¶
func (m MessageTextFileCitationAnnotation) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MessageTextFileCitationAnnotation.
func (*MessageTextFileCitationAnnotation) UnmarshalJSON ¶
func (m *MessageTextFileCitationAnnotation) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MessageTextFileCitationAnnotation.
type MessageTextFileCitationDetails ¶
type MessageTextFileCitationDetails struct { // REQUIRED; The ID of the file associated with this citation. FileID *string // REQUIRED; The specific quote cited in the associated file. Quote *string }
MessageTextFileCitationDetails - A representation of a file-based text citation, as used in a file-based annotation of text thread message content.
func (MessageTextFileCitationDetails) MarshalJSON ¶
func (m MessageTextFileCitationDetails) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MessageTextFileCitationDetails.
func (*MessageTextFileCitationDetails) UnmarshalJSON ¶
func (m *MessageTextFileCitationDetails) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MessageTextFileCitationDetails.
type MessageTextFilePathAnnotation ¶
type MessageTextFilePathAnnotation struct { // REQUIRED; The last text index associated with this text annotation. EndIndex *int32 // REQUIRED; A URL for the file that's generated when the assistant used the code_interpreter tool to generate a file. FilePath *MessageTextFilePathDetails // REQUIRED; The first text index associated with this text annotation. StartIndex *int32 // REQUIRED; The textual content associated with this text annotation item. Text *string // REQUIRED; The object type. Type *string }
MessageTextFilePathAnnotation - A citation within the message that points to a file located at a specific path.
func (*MessageTextFilePathAnnotation) GetMessageTextAnnotation ¶
func (m *MessageTextFilePathAnnotation) GetMessageTextAnnotation() *MessageTextAnnotation
GetMessageTextAnnotation implements the MessageTextAnnotationClassification interface for type MessageTextFilePathAnnotation.
func (MessageTextFilePathAnnotation) MarshalJSON ¶
func (m MessageTextFilePathAnnotation) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MessageTextFilePathAnnotation.
func (*MessageTextFilePathAnnotation) UnmarshalJSON ¶
func (m *MessageTextFilePathAnnotation) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MessageTextFilePathAnnotation.
type MessageTextFilePathDetails ¶
type MessageTextFilePathDetails struct { // REQUIRED; The ID of the specific file that the citation is from. FileID *string }
MessageTextFilePathDetails - An encapsulation of an image file ID, as used by message image content.
func (MessageTextFilePathDetails) MarshalJSON ¶
func (m MessageTextFilePathDetails) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MessageTextFilePathDetails.
func (*MessageTextFilePathDetails) UnmarshalJSON ¶
func (m *MessageTextFilePathDetails) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MessageTextFilePathDetails.
type MessagesPage ¶
type MessagesPage struct { // REQUIRED; The requested list of items. Data []ThreadMessage // REQUIRED; The first ID represented in this list. FirstID *string // REQUIRED; A value indicating whether there are additional values available not captured in this list. HasMore *bool // REQUIRED; The last ID represented in this list. LastID *string // REQUIRED; The object type, which is always list. Object *string }
MessagesPage - The response data for a requested list of items.
func (MessagesPage) MarshalJSON ¶
func (p MessagesPage) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MessagesPage.
func (*MessagesPage) UnmarshalJSON ¶
func (p *MessagesPage) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MessagesPage.
type OpenAIFile ¶
type OpenAIFile struct { // REQUIRED; The size of the file, in bytes. Bytes *int32 // REQUIRED; The Unix timestamp, in seconds, representing when this object was created. CreatedAt *time.Time // REQUIRED; The name of the file. Filename *string // REQUIRED; The identifier, which can be referenced in API endpoints. ID *string // REQUIRED; The object type, which is always 'file'. Object *string // REQUIRED; The intended purpose of a file. Purpose *FilePurpose }
OpenAIFile - Represents an assistant that can call the model and use tools.
func (OpenAIFile) MarshalJSON ¶
func (o OpenAIFile) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OpenAIFile.
func (*OpenAIFile) UnmarshalJSON ¶
func (o *OpenAIFile) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OpenAIFile.
type RequiredAction ¶
type RequiredAction struct { // REQUIRED; The object type. Type *string }
RequiredAction - An abstract representation of a required action for an assistant thread run to continue.
func (*RequiredAction) GetRequiredAction ¶
func (r *RequiredAction) GetRequiredAction() *RequiredAction
GetRequiredAction implements the RequiredActionClassification interface for type RequiredAction.
func (RequiredAction) MarshalJSON ¶
func (r RequiredAction) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RequiredAction.
func (*RequiredAction) UnmarshalJSON ¶
func (r *RequiredAction) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RequiredAction.
type RequiredActionClassification ¶
type RequiredActionClassification interface { // GetRequiredAction returns the RequiredAction content of the underlying type. GetRequiredAction() *RequiredAction }
RequiredActionClassification provides polymorphic access to related types. Call the interface's GetRequiredAction() method to access the common type. Use a type switch to determine the concrete type. The possible types are: - *RequiredAction, *SubmitToolOutputsAction
type RequiredFunctionToolCall ¶
type RequiredFunctionToolCall struct { // REQUIRED; Detailed information about the function to be executed by the tool that includes name and arguments. Function *RequiredFunctionToolCallDetails // REQUIRED; The ID of the tool call. This ID must be referenced when submitting tool outputs. ID *string // REQUIRED; The object type for the required tool call. Type *string }
RequiredFunctionToolCall - A representation of a requested call to a function tool, needed by the model to continue evaluation of a run.
func (*RequiredFunctionToolCall) GetRequiredToolCall ¶
func (r *RequiredFunctionToolCall) GetRequiredToolCall() *RequiredToolCall
GetRequiredToolCall implements the RequiredToolCallClassification interface for type RequiredFunctionToolCall.
func (RequiredFunctionToolCall) MarshalJSON ¶
func (r RequiredFunctionToolCall) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RequiredFunctionToolCall.
func (*RequiredFunctionToolCall) UnmarshalJSON ¶
func (r *RequiredFunctionToolCall) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RequiredFunctionToolCall.
type RequiredFunctionToolCallDetails ¶
type RequiredFunctionToolCallDetails struct { // REQUIRED; The arguments to use when invoking the named function, as provided by the model. Arguments are presented as a // JSON document that should be validated and parsed for evaluation. Arguments *string // REQUIRED; The name of the function. Name *string }
RequiredFunctionToolCallDetails - The detailed information for a function invocation, as provided by a required action invoking a function tool, that includes the name of and arguments to the function.
func (RequiredFunctionToolCallDetails) MarshalJSON ¶
func (r RequiredFunctionToolCallDetails) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RequiredFunctionToolCallDetails.
func (*RequiredFunctionToolCallDetails) UnmarshalJSON ¶
func (r *RequiredFunctionToolCallDetails) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RequiredFunctionToolCallDetails.
type RequiredToolCall ¶
type RequiredToolCall struct { // REQUIRED; The ID of the tool call. This ID must be referenced when submitting tool outputs. ID *string // REQUIRED; The object type for the required tool call. Type *string }
RequiredToolCall - An abstract representation a a tool invocation needed by the model to continue a run.
func (*RequiredToolCall) GetRequiredToolCall ¶
func (r *RequiredToolCall) GetRequiredToolCall() *RequiredToolCall
GetRequiredToolCall implements the RequiredToolCallClassification interface for type RequiredToolCall.
func (RequiredToolCall) MarshalJSON ¶
func (r RequiredToolCall) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RequiredToolCall.
func (*RequiredToolCall) UnmarshalJSON ¶
func (r *RequiredToolCall) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RequiredToolCall.
type RequiredToolCallClassification ¶
type RequiredToolCallClassification interface { // GetRequiredToolCall returns the RequiredToolCall content of the underlying type. GetRequiredToolCall() *RequiredToolCall }
RequiredToolCallClassification provides polymorphic access to related types. Call the interface's GetRequiredToolCall() method to access the common type. Use a type switch to determine the concrete type. The possible types are: - *RequiredFunctionToolCall, *RequiredToolCall
type RetrievalToolDefinition ¶
type RetrievalToolDefinition struct { // REQUIRED; The object type. Type *string }
RetrievalToolDefinition - The input definition information for a retrieval tool as used to configure an assistant.
func (*RetrievalToolDefinition) GetToolDefinition ¶
func (r *RetrievalToolDefinition) GetToolDefinition() *ToolDefinition
GetToolDefinition implements the ToolDefinitionClassification interface for type RetrievalToolDefinition.
func (RetrievalToolDefinition) MarshalJSON ¶
func (r RetrievalToolDefinition) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RetrievalToolDefinition.
func (*RetrievalToolDefinition) UnmarshalJSON ¶
func (r *RetrievalToolDefinition) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RetrievalToolDefinition.
type RunError ¶
type RunError struct { // REQUIRED; The status for the error. Code *string // REQUIRED; The human-readable text associated with the error. Message *string }
RunError - The details of an error as encountered by an assistant thread run.
func (RunError) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type RunError.
func (*RunError) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type RunError.
type RunStatus ¶
type RunStatus string
RunStatus - Possible values for the status of an assistant thread run.
const ( // RunStatusCancelled - Represents a run that has been cancelled. RunStatusCancelled RunStatus = "cancelled" // RunStatusCancelling - Represents a run that is in the process of cancellation. RunStatusCancelling RunStatus = "cancelling" // RunStatusCompleted - Represents a run that successfully completed. RunStatusCompleted RunStatus = "completed" // RunStatusExpired - Represents a run that expired before it could otherwise finish. RunStatusExpired RunStatus = "expired" // RunStatusFailed - Represents a run that failed. RunStatusFailed RunStatus = "failed" // RunStatusInProgress - Represents a run that is in progress. RunStatusInProgress RunStatus = "in_progress" // RunStatusQueued - Represents a run that is queued to start. RunStatusQueued RunStatus = "queued" // RunStatusRequiresAction - Represents a run that needs another operation, such as tool output submission, to continue. RunStatusRequiresAction RunStatus = "requires_action" )
func PossibleRunStatusValues ¶
func PossibleRunStatusValues() []RunStatus
PossibleRunStatusValues returns the possible values for the RunStatus const type.
type RunStep ¶
type RunStep struct { // REQUIRED; The ID of the assistant associated with the run step. AssistantID *string // REQUIRED; The Unix timestamp, in seconds, representing when this was cancelled. CancelledAt *time.Time // REQUIRED; The Unix timestamp, in seconds, representing when this completed. CompletedAt *time.Time // REQUIRED; The Unix timestamp, in seconds, representing when this object was created. CreatedAt *time.Time // REQUIRED; The Unix timestamp, in seconds, representing when this item expired. ExpiredAt *time.Time // REQUIRED; The Unix timestamp, in seconds, representing when this failed. FailedAt *time.Time // REQUIRED; The identifier, which can be referenced in API endpoints. ID *string // REQUIRED; If applicable, information about the last error encountered by this run step. LastError *RunStepLastError // REQUIRED; A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information // about that object in a structured format. Keys may be up to 64 characters in length and // values may be up to 512 characters in length. Metadata map[string]*string // REQUIRED; The object type, which is always 'thread.run.step'. Object *string // REQUIRED; The ID of the run that this run step is a part of. RunID *string // REQUIRED; The status of this run step. Status *RunStepStatus // REQUIRED; The details for this run step. StepDetails RunStepDetailsClassification // REQUIRED; The ID of the thread that was run. ThreadID *string // REQUIRED; The type of run step, which can be either messagecreation or toolcalls. Type *RunStepType }
RunStep - Detailed information about a single step of an assistant thread run.
func (RunStep) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type RunStep.
func (*RunStep) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type RunStep.
type RunStepCodeInterpreterImageOutput ¶
type RunStepCodeInterpreterImageOutput struct { // REQUIRED; Referential information for the image associated with this output. Image *RunStepCodeInterpreterImageReference // REQUIRED; The object type. Type *string }
RunStepCodeInterpreterImageOutput - A representation of an image output emitted by a code interpreter tool in response to a tool call by the model.
func (*RunStepCodeInterpreterImageOutput) GetRunStepCodeInterpreterToolCallOutput ¶
func (r *RunStepCodeInterpreterImageOutput) GetRunStepCodeInterpreterToolCallOutput() *RunStepCodeInterpreterToolCallOutput
GetRunStepCodeInterpreterToolCallOutput implements the RunStepCodeInterpreterToolCallOutputClassification interface for type RunStepCodeInterpreterImageOutput.
func (RunStepCodeInterpreterImageOutput) MarshalJSON ¶
func (r RunStepCodeInterpreterImageOutput) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RunStepCodeInterpreterImageOutput.
func (*RunStepCodeInterpreterImageOutput) UnmarshalJSON ¶
func (r *RunStepCodeInterpreterImageOutput) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RunStepCodeInterpreterImageOutput.
type RunStepCodeInterpreterImageReference ¶
type RunStepCodeInterpreterImageReference struct { // REQUIRED; The ID of the file associated with this image. FileID *string }
RunStepCodeInterpreterImageReference - An image reference emitted by a code interpreter tool in response to a tool call by the model.
func (RunStepCodeInterpreterImageReference) MarshalJSON ¶
func (r RunStepCodeInterpreterImageReference) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RunStepCodeInterpreterImageReference.
func (*RunStepCodeInterpreterImageReference) UnmarshalJSON ¶
func (r *RunStepCodeInterpreterImageReference) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RunStepCodeInterpreterImageReference.
type RunStepCodeInterpreterLogOutput ¶
type RunStepCodeInterpreterLogOutput struct { // REQUIRED; The serialized log output emitted by the code interpreter. Logs *string // REQUIRED; The object type. Type *string }
RunStepCodeInterpreterLogOutput - A representation of a log output emitted by a code interpreter tool in response to a tool call by the model.
func (*RunStepCodeInterpreterLogOutput) GetRunStepCodeInterpreterToolCallOutput ¶
func (r *RunStepCodeInterpreterLogOutput) GetRunStepCodeInterpreterToolCallOutput() *RunStepCodeInterpreterToolCallOutput
GetRunStepCodeInterpreterToolCallOutput implements the RunStepCodeInterpreterToolCallOutputClassification interface for type RunStepCodeInterpreterLogOutput.
func (RunStepCodeInterpreterLogOutput) MarshalJSON ¶
func (r RunStepCodeInterpreterLogOutput) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RunStepCodeInterpreterLogOutput.
func (*RunStepCodeInterpreterLogOutput) UnmarshalJSON ¶
func (r *RunStepCodeInterpreterLogOutput) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RunStepCodeInterpreterLogOutput.
type RunStepCodeInterpreterToolCall ¶
type RunStepCodeInterpreterToolCall struct { // REQUIRED; The details of the tool call to the code interpreter tool. CodeInterpreter *RunStepCodeInterpreterToolCallDetails // REQUIRED; The ID of the tool call. This ID must be referenced when you submit tool outputs. ID *string // REQUIRED; The object type. Type *string }
RunStepCodeInterpreterToolCall - A record of a call to a code interpreter tool, issued by the model in evaluation of a defined tool, that represents inputs and outputs consumed and emitted by the code interpreter.
func (*RunStepCodeInterpreterToolCall) GetRunStepToolCall ¶
func (r *RunStepCodeInterpreterToolCall) GetRunStepToolCall() *RunStepToolCall
GetRunStepToolCall implements the RunStepToolCallClassification interface for type RunStepCodeInterpreterToolCall.
func (RunStepCodeInterpreterToolCall) MarshalJSON ¶
func (r RunStepCodeInterpreterToolCall) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RunStepCodeInterpreterToolCall.
func (*RunStepCodeInterpreterToolCall) UnmarshalJSON ¶
func (r *RunStepCodeInterpreterToolCall) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RunStepCodeInterpreterToolCall.
type RunStepCodeInterpreterToolCallDetails ¶
type RunStepCodeInterpreterToolCallDetails struct { // REQUIRED; The input provided by the model to the code interpreter tool. Input *string // REQUIRED; The outputs produced by the code interpreter tool back to the model in response to the tool call. Outputs []RunStepCodeInterpreterToolCallOutputClassification }
RunStepCodeInterpreterToolCallDetails - The detailed information about a code interpreter invocation by the model.
func (RunStepCodeInterpreterToolCallDetails) MarshalJSON ¶
func (r RunStepCodeInterpreterToolCallDetails) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RunStepCodeInterpreterToolCallDetails.
func (*RunStepCodeInterpreterToolCallDetails) UnmarshalJSON ¶
func (r *RunStepCodeInterpreterToolCallDetails) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RunStepCodeInterpreterToolCallDetails.
type RunStepCodeInterpreterToolCallOutput ¶
type RunStepCodeInterpreterToolCallOutput struct { // REQUIRED; The object type. Type *string }
RunStepCodeInterpreterToolCallOutput - An abstract representation of an emitted output from a code interpreter tool.
func (*RunStepCodeInterpreterToolCallOutput) GetRunStepCodeInterpreterToolCallOutput ¶
func (r *RunStepCodeInterpreterToolCallOutput) GetRunStepCodeInterpreterToolCallOutput() *RunStepCodeInterpreterToolCallOutput
GetRunStepCodeInterpreterToolCallOutput implements the RunStepCodeInterpreterToolCallOutputClassification interface for type RunStepCodeInterpreterToolCallOutput.
func (RunStepCodeInterpreterToolCallOutput) MarshalJSON ¶
func (r RunStepCodeInterpreterToolCallOutput) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RunStepCodeInterpreterToolCallOutput.
func (*RunStepCodeInterpreterToolCallOutput) UnmarshalJSON ¶
func (r *RunStepCodeInterpreterToolCallOutput) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RunStepCodeInterpreterToolCallOutput.
type RunStepCodeInterpreterToolCallOutputClassification ¶
type RunStepCodeInterpreterToolCallOutputClassification interface { // GetRunStepCodeInterpreterToolCallOutput returns the RunStepCodeInterpreterToolCallOutput content of the underlying type. GetRunStepCodeInterpreterToolCallOutput() *RunStepCodeInterpreterToolCallOutput }
RunStepCodeInterpreterToolCallOutputClassification provides polymorphic access to related types. Call the interface's GetRunStepCodeInterpreterToolCallOutput() method to access the common type. Use a type switch to determine the concrete type. The possible types are: - *RunStepCodeInterpreterImageOutput, *RunStepCodeInterpreterLogOutput, *RunStepCodeInterpreterToolCallOutput
type RunStepDetails ¶
type RunStepDetails struct { // REQUIRED; The object type. Type *RunStepType }
RunStepDetails - An abstract representation of the details for a run step.
func (*RunStepDetails) GetRunStepDetails ¶
func (r *RunStepDetails) GetRunStepDetails() *RunStepDetails
GetRunStepDetails implements the RunStepDetailsClassification interface for type RunStepDetails.
func (RunStepDetails) MarshalJSON ¶
func (r RunStepDetails) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RunStepDetails.
func (*RunStepDetails) UnmarshalJSON ¶
func (r *RunStepDetails) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RunStepDetails.
type RunStepDetailsClassification ¶
type RunStepDetailsClassification interface { // GetRunStepDetails returns the RunStepDetails content of the underlying type. GetRunStepDetails() *RunStepDetails }
RunStepDetailsClassification provides polymorphic access to related types. Call the interface's GetRunStepDetails() method to access the common type. Use a type switch to determine the concrete type. The possible types are: - *RunStepDetails, *RunStepMessageCreationDetails, *RunStepToolCallDetails
type RunStepError ¶
type RunStepError struct { // REQUIRED; The error code for this error. Code *RunStepErrorCode // REQUIRED; The human-readable text associated with this error. Message *string }
RunStepError - The error information associated with a failed run step.
func (RunStepError) MarshalJSON ¶
func (r RunStepError) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RunStepError.
func (*RunStepError) UnmarshalJSON ¶
func (r *RunStepError) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RunStepError.
type RunStepErrorCode ¶
type RunStepErrorCode string
RunStepErrorCode - Possible error code values attributable to a failed run step.
const ( // RunStepErrorCodeRateLimitExceeded - Represents an error indicating configured rate limits were exceeded. RunStepErrorCodeRateLimitExceeded RunStepErrorCode = "rate_limit_exceeded" // RunStepErrorCodeServerError - Represents a server error. RunStepErrorCodeServerError RunStepErrorCode = "server_error" )
func PossibleRunStepErrorCodeValues ¶
func PossibleRunStepErrorCodeValues() []RunStepErrorCode
PossibleRunStepErrorCodeValues returns the possible values for the RunStepErrorCode const type.
type RunStepFunctionToolCall ¶
type RunStepFunctionToolCall struct { // REQUIRED; The detailed information about the function called by the model. Function *RunStepFunctionToolCallDetails // REQUIRED; The ID of the tool call. This ID must be referenced when you submit tool outputs. ID *string // REQUIRED; The object type. Type *string }
RunStepFunctionToolCall - A record of a call to a function tool, issued by the model in evaluation of a defined tool, that represents the inputs and output consumed and emitted by the specified function.
func (*RunStepFunctionToolCall) GetRunStepToolCall ¶
func (r *RunStepFunctionToolCall) GetRunStepToolCall() *RunStepToolCall
GetRunStepToolCall implements the RunStepToolCallClassification interface for type RunStepFunctionToolCall.
func (RunStepFunctionToolCall) MarshalJSON ¶
func (r RunStepFunctionToolCall) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RunStepFunctionToolCall.
func (*RunStepFunctionToolCall) UnmarshalJSON ¶
func (r *RunStepFunctionToolCall) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RunStepFunctionToolCall.
type RunStepFunctionToolCallDetails ¶
type RunStepFunctionToolCallDetails struct { // REQUIRED; The arguments that the model requires are provided to the named function. Arguments *string // REQUIRED; The name of the function. Name *string // REQUIRED; The output of the function, only populated for function calls that have already have had their outputs submitted. Output *string }
RunStepFunctionToolCallDetails - The detailed information about the function called by the model.
func (RunStepFunctionToolCallDetails) MarshalJSON ¶
func (r RunStepFunctionToolCallDetails) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RunStepFunctionToolCallDetails.
func (*RunStepFunctionToolCallDetails) UnmarshalJSON ¶
func (r *RunStepFunctionToolCallDetails) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RunStepFunctionToolCallDetails.
type RunStepLastError ¶
type RunStepLastError struct { // REQUIRED; The error code for this error. Code *RunStepErrorCode // REQUIRED; The human-readable text associated with this error. Message *string }
RunStepLastError - If applicable, information about the last error encountered by this run step.
func (RunStepLastError) MarshalJSON ¶
func (r RunStepLastError) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RunStepLastError.
func (*RunStepLastError) UnmarshalJSON ¶
func (r *RunStepLastError) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RunStepLastError.
type RunStepMessageCreationDetails ¶
type RunStepMessageCreationDetails struct { // REQUIRED; Information about the message creation associated with this run step. MessageCreation *RunStepMessageCreationReference // REQUIRED; The object type. Type *RunStepType }
RunStepMessageCreationDetails - The detailed information associated with a message creation run step.
func (*RunStepMessageCreationDetails) GetRunStepDetails ¶
func (r *RunStepMessageCreationDetails) GetRunStepDetails() *RunStepDetails
GetRunStepDetails implements the RunStepDetailsClassification interface for type RunStepMessageCreationDetails.
func (RunStepMessageCreationDetails) MarshalJSON ¶
func (r RunStepMessageCreationDetails) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RunStepMessageCreationDetails.
func (*RunStepMessageCreationDetails) UnmarshalJSON ¶
func (r *RunStepMessageCreationDetails) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RunStepMessageCreationDetails.
type RunStepMessageCreationReference ¶
type RunStepMessageCreationReference struct { // REQUIRED; The ID of the message created by this run step. MessageID *string }
RunStepMessageCreationReference - The details of a message created as a part of a run step.
func (RunStepMessageCreationReference) MarshalJSON ¶
func (r RunStepMessageCreationReference) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RunStepMessageCreationReference.
func (*RunStepMessageCreationReference) UnmarshalJSON ¶
func (r *RunStepMessageCreationReference) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RunStepMessageCreationReference.
type RunStepRetrievalToolCall ¶
type RunStepRetrievalToolCall struct { // REQUIRED; The ID of the tool call. This ID must be referenced when you submit tool outputs. ID *string // REQUIRED; The key/value pairs produced by the retrieval tool. Retrieval map[string]*string // REQUIRED; The object type. Type *string }
RunStepRetrievalToolCall - A record of a call to a retrieval tool, issued by the model in evaluation of a defined tool, that represents executed retrieval actions.
func (*RunStepRetrievalToolCall) GetRunStepToolCall ¶
func (r *RunStepRetrievalToolCall) GetRunStepToolCall() *RunStepToolCall
GetRunStepToolCall implements the RunStepToolCallClassification interface for type RunStepRetrievalToolCall.
func (RunStepRetrievalToolCall) MarshalJSON ¶
func (r RunStepRetrievalToolCall) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RunStepRetrievalToolCall.
func (*RunStepRetrievalToolCall) UnmarshalJSON ¶
func (r *RunStepRetrievalToolCall) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RunStepRetrievalToolCall.
type RunStepStatus ¶
type RunStepStatus string
RunStepStatus - Possible values for the status of a run step.
const ( // RunStepStatusCancelled - Represents a run step that was cancelled. RunStepStatusCancelled RunStepStatus = "cancelled" // RunStepStatusCompleted - Represents a run step that successfully completed. RunStepStatusCompleted RunStepStatus = "completed" // RunStepStatusExpired - Represents a run step that expired before otherwise finishing. RunStepStatusExpired RunStepStatus = "expired" // RunStepStatusFailed - Represents a run step that failed. RunStepStatusFailed RunStepStatus = "failed" // RunStepStatusInProgress - Represents a run step still in progress. RunStepStatusInProgress RunStepStatus = "in_progress" )
func PossibleRunStepStatusValues ¶
func PossibleRunStepStatusValues() []RunStepStatus
PossibleRunStepStatusValues returns the possible values for the RunStepStatus const type.
type RunStepToolCall ¶
type RunStepToolCall struct { // REQUIRED; The ID of the tool call. This ID must be referenced when you submit tool outputs. ID *string // REQUIRED; The object type. Type *string }
RunStepToolCall - An abstract representation of a detailed tool call as recorded within a run step for an existing run.
func (*RunStepToolCall) GetRunStepToolCall ¶
func (r *RunStepToolCall) GetRunStepToolCall() *RunStepToolCall
GetRunStepToolCall implements the RunStepToolCallClassification interface for type RunStepToolCall.
func (RunStepToolCall) MarshalJSON ¶
func (r RunStepToolCall) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RunStepToolCall.
func (*RunStepToolCall) UnmarshalJSON ¶
func (r *RunStepToolCall) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RunStepToolCall.
type RunStepToolCallClassification ¶
type RunStepToolCallClassification interface { // GetRunStepToolCall returns the RunStepToolCall content of the underlying type. GetRunStepToolCall() *RunStepToolCall }
RunStepToolCallClassification provides polymorphic access to related types. Call the interface's GetRunStepToolCall() method to access the common type. Use a type switch to determine the concrete type. The possible types are: - *RunStepCodeInterpreterToolCall, *RunStepFunctionToolCall, *RunStepRetrievalToolCall, *RunStepToolCall
type RunStepToolCallDetails ¶
type RunStepToolCallDetails struct { // REQUIRED; A list of tool call details for this run step. ToolCalls []RunStepToolCallClassification // REQUIRED; The object type. Type *RunStepType }
RunStepToolCallDetails - The detailed information associated with a run step calling tools.
func (*RunStepToolCallDetails) GetRunStepDetails ¶
func (r *RunStepToolCallDetails) GetRunStepDetails() *RunStepDetails
GetRunStepDetails implements the RunStepDetailsClassification interface for type RunStepToolCallDetails.
func (RunStepToolCallDetails) MarshalJSON ¶
func (r RunStepToolCallDetails) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RunStepToolCallDetails.
func (*RunStepToolCallDetails) UnmarshalJSON ¶
func (r *RunStepToolCallDetails) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RunStepToolCallDetails.
type RunStepType ¶
type RunStepType string
RunStepType - The possible types of run steps.
const ( // RunStepTypeMessageCreation - Represents a run step to create a message. RunStepTypeMessageCreation RunStepType = "message_creation" // RunStepTypeToolCalls - Represents a run step that calls tools. RunStepTypeToolCalls RunStepType = "tool_calls" )
func PossibleRunStepTypeValues ¶
func PossibleRunStepTypeValues() []RunStepType
PossibleRunStepTypeValues returns the possible values for the RunStepType const type.
type RunStepsPage ¶
type RunStepsPage struct { // REQUIRED; The requested list of items. Data []RunStep // REQUIRED; The first ID represented in this list. FirstID *string // REQUIRED; A value indicating whether there are additional values available not captured in this list. HasMore *bool // REQUIRED; The last ID represented in this list. LastID *string // REQUIRED; The object type, which is always list. Object *string }
RunStepsPage - The response data for a requested list of items.
func (RunStepsPage) MarshalJSON ¶
func (p RunStepsPage) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type RunStepsPage.
func (*RunStepsPage) UnmarshalJSON ¶
func (p *RunStepsPage) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type RunStepsPage.
type ServiceAPIVersions ¶
type ServiceAPIVersions string
ServiceAPIVersions - The known set of supported API versions.
const ( // ServiceAPIVersionsV20240215Preview - The initial version of Azure OpenAI Assistants that corresponds to functionality in // OpenAI's first beta release. ServiceAPIVersionsV20240215Preview ServiceAPIVersions = "2024-02-15-preview" )
func PossibleServiceAPIVersionsValues ¶
func PossibleServiceAPIVersionsValues() []ServiceAPIVersions
PossibleServiceAPIVersionsValues returns the possible values for the ServiceAPIVersions const type.
type SubmitToolOutputsAction ¶
type SubmitToolOutputsAction struct { // REQUIRED; The details describing tools that should be called to submit tool outputs. SubmitToolOutputs *SubmitToolOutputsDetails // REQUIRED; The object type. Type *string }
SubmitToolOutputsAction - The details for required tool calls that must be submitted for an assistant thread run to continue.
func (*SubmitToolOutputsAction) GetRequiredAction ¶
func (s *SubmitToolOutputsAction) GetRequiredAction() *RequiredAction
GetRequiredAction implements the RequiredActionClassification interface for type SubmitToolOutputsAction.
func (SubmitToolOutputsAction) MarshalJSON ¶
func (s SubmitToolOutputsAction) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SubmitToolOutputsAction.
func (*SubmitToolOutputsAction) UnmarshalJSON ¶
func (s *SubmitToolOutputsAction) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SubmitToolOutputsAction.
type SubmitToolOutputsDetails ¶
type SubmitToolOutputsDetails struct { // REQUIRED; The list of tool calls that must be resolved for the assistant thread run to continue. ToolCalls []RequiredToolCallClassification }
SubmitToolOutputsDetails - The details describing tools that should be called to submit tool outputs.
func (SubmitToolOutputsDetails) MarshalJSON ¶
func (s SubmitToolOutputsDetails) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SubmitToolOutputsDetails.
func (*SubmitToolOutputsDetails) UnmarshalJSON ¶
func (s *SubmitToolOutputsDetails) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SubmitToolOutputsDetails.
type SubmitToolOutputsToRunBody ¶
type SubmitToolOutputsToRunBody struct { // REQUIRED; The list of tool outputs requested by tool calls from the specified run. ToolOutputs []ToolOutput }
SubmitToolOutputsToRunBody - The request details to use when submitting tool outputs.
func (SubmitToolOutputsToRunBody) MarshalJSON ¶
func (p SubmitToolOutputsToRunBody) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SubmitToolOutputsToRunBody.
func (*SubmitToolOutputsToRunBody) UnmarshalJSON ¶
func (p *SubmitToolOutputsToRunBody) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SubmitToolOutputsToRunBody.
type SubmitToolOutputsToRunOptions ¶
type SubmitToolOutputsToRunOptions struct { }
SubmitToolOutputsToRunOptions contains the optional parameters for the Client.SubmitToolOutputsToRun method.
type SubmitToolOutputsToRunResponse ¶
type SubmitToolOutputsToRunResponse struct { // Data representing a single evaluation run of an assistant thread. ThreadRun }
SubmitToolOutputsToRunResponse contains the response from method Client.SubmitToolOutputsToRun.
type ThreadDeletionStatus ¶
type ThreadDeletionStatus struct { // REQUIRED; A value indicating whether deletion was successful. Deleted *bool // REQUIRED; The ID of the resource specified for deletion. ID *string // REQUIRED; The object type, which is always 'thread.deleted'. Object *string }
ThreadDeletionStatus - The status of a thread deletion operation.
func (ThreadDeletionStatus) MarshalJSON ¶
func (t ThreadDeletionStatus) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ThreadDeletionStatus.
func (*ThreadDeletionStatus) UnmarshalJSON ¶
func (t *ThreadDeletionStatus) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ThreadDeletionStatus.
type ThreadInitializationMessage ¶
type ThreadInitializationMessage struct { // REQUIRED; The textual content of the initial message. Currently, robust input including images and annotated text may only // be provided via a separate call to the create message API. Content *string // REQUIRED; The role associated with the assistant thread message. Currently, only 'user' is supported when providing initial // messages to a new thread. Role *MessageRole // A list of file IDs that the assistant should use. Useful for tools like retrieval and code_interpreter that can access // files. FileIDs []string // A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that // object in a structured format. Keys may be up to 64 characters in length and // values may be up to 512 characters in length. Metadata map[string]*string }
ThreadInitializationMessage - A single message within an assistant thread, as provided during that thread's creation for its initial state.
func (ThreadInitializationMessage) MarshalJSON ¶
func (t ThreadInitializationMessage) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ThreadInitializationMessage.
func (*ThreadInitializationMessage) UnmarshalJSON ¶
func (t *ThreadInitializationMessage) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ThreadInitializationMessage.
type ThreadMessage ¶
type ThreadMessage struct { // REQUIRED; The list of content items associated with the assistant thread message. Content []MessageContentClassification // REQUIRED; The Unix timestamp, in seconds, representing when this object was created. CreatedAt *time.Time // REQUIRED; A list of file IDs that the assistant should use. Useful for tools like retrieval and code_interpreter that can // access files. FileIDs []string // REQUIRED; The identifier, which can be referenced in API endpoints. ID *string // REQUIRED; A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information // about that object in a structured format. Keys may be up to 64 characters in length and // values may be up to 512 characters in length. Metadata map[string]*string // REQUIRED; The object type, which is always 'thread.message'. Object *string // REQUIRED; The role associated with the assistant thread message. Role *MessageRole // REQUIRED; The ID of the thread that this message belongs to. ThreadID *string // If applicable, the ID of the assistant that authored this message. AssistantID *string // If applicable, the ID of the run associated with the authoring of this message. RunID *string }
ThreadMessage - A single, existing message within an assistant thread.
func (ThreadMessage) MarshalJSON ¶
func (t ThreadMessage) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ThreadMessage.
func (*ThreadMessage) UnmarshalJSON ¶
func (t *ThreadMessage) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ThreadMessage.
type ThreadRun ¶
type ThreadRun struct { // REQUIRED; The ID of the assistant associated with the thread this run was performed against. AssistantID *string // REQUIRED; The Unix timestamp, in seconds, representing when this was cancelled. CancelledAt *time.Time // REQUIRED; The Unix timestamp, in seconds, representing when this completed. CompletedAt *time.Time // REQUIRED; The Unix timestamp, in seconds, representing when this object was created. CreatedAt *time.Time // REQUIRED; The Unix timestamp, in seconds, representing when this item expires. ExpiresAt *time.Time // REQUIRED; The Unix timestamp, in seconds, representing when this failed. FailedAt *time.Time // REQUIRED; A list of attached file IDs, ordered by creation date in ascending order. FileIDs []string // REQUIRED; The identifier, which can be referenced in API endpoints. ID *string // REQUIRED; The overridden system instructions used for this assistant thread run. Instructions *string // REQUIRED; The last error, if any, encountered by this assistant thread run. LastError *ThreadRunLastError // REQUIRED; A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information // about that object in a structured format. Keys may be up to 64 characters in length and // values may be up to 512 characters in length. Metadata map[string]*string // REQUIRED; The ID of the model to use. DeploymentName *string // REQUIRED; The object type, which is always 'thread.run'. Object *string // REQUIRED; The Unix timestamp, in seconds, representing when this item was started. StartedAt *time.Time // REQUIRED; The status of the assistant thread run. Status *RunStatus // REQUIRED; The ID of the thread associated with this run. ThreadID *string // REQUIRED; The overridden enabled tools used for this assistant thread run. Tools []ToolDefinitionClassification // The details of the action required for the assistant thread run to continue. RequiredAction RequiredActionClassification }
ThreadRun - Data representing a single evaluation run of an assistant thread.
func (ThreadRun) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type ThreadRun.
func (*ThreadRun) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type ThreadRun.
type ThreadRunLastError ¶
type ThreadRunLastError struct { // REQUIRED; The status for the error. Code *string // REQUIRED; The human-readable text associated with the error. Message *string }
ThreadRunLastError - The last error, if any, encountered by this assistant thread run.
func (ThreadRunLastError) MarshalJSON ¶
func (t ThreadRunLastError) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ThreadRunLastError.
func (*ThreadRunLastError) UnmarshalJSON ¶
func (t *ThreadRunLastError) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ThreadRunLastError.
type ThreadRunsPage ¶
type ThreadRunsPage struct { // REQUIRED; The requested list of items. Data []ThreadRun // REQUIRED; The first ID represented in this list. FirstID *string // REQUIRED; A value indicating whether there are additional values available not captured in this list. HasMore *bool // REQUIRED; The last ID represented in this list. LastID *string // REQUIRED; The object type, which is always list. Object *string }
ThreadRunsPage - The response data for a requested list of items.
func (ThreadRunsPage) MarshalJSON ¶
func (p ThreadRunsPage) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ThreadRunsPage.
func (*ThreadRunsPage) UnmarshalJSON ¶
func (p *ThreadRunsPage) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ThreadRunsPage.
type ToolDefinition ¶
type ToolDefinition struct { // REQUIRED; The object type. Type *string }
ToolDefinition - An abstract representation of an input tool definition that an assistant can use.
func (*ToolDefinition) GetToolDefinition ¶
func (t *ToolDefinition) GetToolDefinition() *ToolDefinition
GetToolDefinition implements the ToolDefinitionClassification interface for type ToolDefinition.
func (ToolDefinition) MarshalJSON ¶
func (t ToolDefinition) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ToolDefinition.
func (*ToolDefinition) UnmarshalJSON ¶
func (t *ToolDefinition) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ToolDefinition.
type ToolDefinitionClassification ¶
type ToolDefinitionClassification interface { // GetToolDefinition returns the ToolDefinition content of the underlying type. GetToolDefinition() *ToolDefinition }
ToolDefinitionClassification provides polymorphic access to related types. Call the interface's GetToolDefinition() method to access the common type. Use a type switch to determine the concrete type. The possible types are: - *CodeInterpreterToolDefinition, *FunctionToolDefinition, *RetrievalToolDefinition, *ToolDefinition
type ToolOutput ¶
type ToolOutput struct { // The output from the tool to be submitted. Output *string // The ID of the tool call being resolved, as provided in the tool calls of a required action from a run. ToolCallID *string }
ToolOutput - The data provided during a tool outputs submission to resolve pending tool calls and allow the model to continue.
func (ToolOutput) MarshalJSON ¶
func (t ToolOutput) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ToolOutput.
func (*ToolOutput) UnmarshalJSON ¶
func (t *ToolOutput) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ToolOutput.
type UpdateAssistantBody ¶
type UpdateAssistantBody struct { // The modified description for the assistant to use. Description *string // The modified list of previously uploaded fileIDs to attach to the assistant. FileIDs []string // The modified system instructions for the new assistant to use. Instructions *string // A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that // object in a structured format. Keys may be up to 64 characters in length and // values may be up to 512 characters in length. Metadata map[string]*string // The ID of the model to use. DeploymentName *string // The modified name for the assistant to use. Name *string // The modified collection of tools to enable for the assistant. Tools []ToolDefinitionClassification }
UpdateAssistantBody - The request details to use when modifying an existing assistant.
func (UpdateAssistantBody) MarshalJSON ¶
func (u UpdateAssistantBody) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type UpdateAssistantBody.
func (*UpdateAssistantBody) UnmarshalJSON ¶
func (u *UpdateAssistantBody) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type UpdateAssistantBody.
type UpdateAssistantOptions ¶
type UpdateAssistantOptions struct { }
UpdateAssistantOptions contains the optional parameters for the Client.UpdateAssistant method.
type UpdateAssistantResponse ¶
type UpdateAssistantResponse struct { // Represents an assistant that can call the model and use tools. Assistant }
UpdateAssistantResponse contains the response from method Client.UpdateAssistant.
type UpdateMessageBody ¶
type UpdateMessageBody struct { // A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that // object in a structured format. Keys may be up to 64 characters in length and // values may be up to 512 characters in length. Metadata map[string]*string }
UpdateMessageBody - The request details to use when updating a message.
func (UpdateMessageBody) MarshalJSON ¶
func (p UpdateMessageBody) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type UpdateMessageBody.
func (*UpdateMessageBody) UnmarshalJSON ¶
func (p *UpdateMessageBody) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type UpdateMessageBody.
type UpdateMessageOptions ¶
type UpdateMessageOptions struct { }
UpdateMessageOptions contains the optional parameters for the Client.UpdateMessage method.
type UpdateMessageResponse ¶
type UpdateMessageResponse struct { // A single, existing message within an assistant thread. ThreadMessage }
UpdateMessageResponse contains the response from method Client.UpdateMessage.
type UpdateRunBody ¶
type UpdateRunBody struct { // A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that // object in a structured format. Keys may be up to 64 characters in length and // values may be up to 512 characters in length. Metadata map[string]*string }
UpdateRunBody - The request details to use when updating a run.
func (UpdateRunBody) MarshalJSON ¶
func (p UpdateRunBody) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type UpdateRunBody.
func (*UpdateRunBody) UnmarshalJSON ¶
func (p *UpdateRunBody) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type UpdateRunBody.
type UpdateRunOptions ¶
type UpdateRunOptions struct { }
UpdateRunOptions contains the optional parameters for the Client.UpdateRun method.
type UpdateRunResponse ¶
type UpdateRunResponse struct { // Data representing a single evaluation run of an assistant thread. ThreadRun }
UpdateRunResponse contains the response from method Client.UpdateRun.
type UpdateThreadBody ¶
type UpdateThreadBody struct { // A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that // object in a structured format. Keys may be up to 64 characters in length and // values may be up to 512 characters in length. Metadata map[string]*string }
UpdateThreadBody - The request details to use when creating a thread.
func (UpdateThreadBody) MarshalJSON ¶
func (p UpdateThreadBody) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type UpdateThreadBody.
func (*UpdateThreadBody) UnmarshalJSON ¶
func (p *UpdateThreadBody) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type UpdateThreadBody.
type UpdateThreadOptions ¶
type UpdateThreadOptions struct { }
UpdateThreadOptions contains the optional parameters for the Client.UpdateThread method.
type UpdateThreadResponse ¶
type UpdateThreadResponse struct { // Information about a single thread associated with an assistant. AssistantThread }
UpdateThreadResponse contains the response from method Client.UpdateThread.
type UploadFileOptions ¶
type UploadFileOptions struct { // A filename to associate with the uploaded data. Filename *string }
UploadFileOptions contains the optional parameters for the Client.UploadFile method.
type UploadFileResponse ¶
type UploadFileResponse struct { // Represents an assistant that can call the model and use tools. OpenAIFile }
UploadFileResponse contains the response from method Client.UploadFile.