runs

package
v0.0.0-...-204702d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 14, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RunService_Create_FullMethodName          = "/yandex.cloud.ai.assistants.v1.runs.RunService/Create"
	RunService_Listen_FullMethodName          = "/yandex.cloud.ai.assistants.v1.runs.RunService/Listen"
	RunService_Get_FullMethodName             = "/yandex.cloud.ai.assistants.v1.runs.RunService/Get"
	RunService_GetLastByThread_FullMethodName = "/yandex.cloud.ai.assistants.v1.runs.RunService/GetLastByThread"
	RunService_List_FullMethodName            = "/yandex.cloud.ai.assistants.v1.runs.RunService/List"
)

Variables

View Source
var (
	RunState_RunStatus_name = map[int32]string{
		0: "RUN_STATUS_UNSPECIFIED",
		1: "PENDING",
		2: "IN_PROGRESS",
		3: "FAILED",
		4: "COMPLETED",
	}
	RunState_RunStatus_value = map[string]int32{
		"RUN_STATUS_UNSPECIFIED": 0,
		"PENDING":                1,
		"IN_PROGRESS":            2,
		"FAILED":                 3,
		"COMPLETED":              4,
	}
)

Enum value maps for RunState_RunStatus.

View Source
var (
	StreamEvent_EventType_name = map[int32]string{
		0: "EVENT_TYPE_UNSPECIFIED",
		1: "PARTIAL_MESSAGE",
		2: "ERROR",
		3: "DONE",
	}
	StreamEvent_EventType_value = map[string]int32{
		"EVENT_TYPE_UNSPECIFIED": 0,
		"PARTIAL_MESSAGE":        1,
		"ERROR":                  2,
		"DONE":                   3,
	}
)

Enum value maps for StreamEvent_EventType.

View Source
var File_yandex_cloud_ai_assistants_v1_runs_run_proto protoreflect.FileDescriptor
View Source
var File_yandex_cloud_ai_assistants_v1_runs_run_service_proto protoreflect.FileDescriptor
View Source
var RunService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "yandex.cloud.ai.assistants.v1.runs.RunService",
	HandlerType: (*RunServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Create",
			Handler:    _RunService_Create_Handler,
		},
		{
			MethodName: "Get",
			Handler:    _RunService_Get_Handler,
		},
		{
			MethodName: "GetLastByThread",
			Handler:    _RunService_GetLastByThread_Handler,
		},
		{
			MethodName: "List",
			Handler:    _RunService_List_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Listen",
			Handler:       _RunService_Listen_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "yandex/cloud/ai/assistants/v1/runs/run_service.proto",
}

RunService_ServiceDesc is the grpc.ServiceDesc for RunService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterRunServiceServer

func RegisterRunServiceServer(s grpc.ServiceRegistrar, srv RunServiceServer)

Types

type ContentUsage

type ContentUsage struct {

	// The number of tokens used in the prompt.
	PromptTokens int64 `protobuf:"varint,1,opt,name=prompt_tokens,json=promptTokens,proto3" json:"prompt_tokens,omitempty"`
	// The number of tokens used in the completion response.
	CompletionTokens int64 `protobuf:"varint,2,opt,name=completion_tokens,json=completionTokens,proto3" json:"completion_tokens,omitempty"`
	// The total number of tokens used (prompt + completion).
	TotalTokens int64 `protobuf:"varint,3,opt,name=total_tokens,json=totalTokens,proto3" json:"total_tokens,omitempty"`
	// contains filtered or unexported fields
}

Represents the content usage during a run, such as the number of [tokens](/docs/foundation-models/concepts/yandexgpt/tokens) used by the completion model.

func (*ContentUsage) Descriptor deprecated

func (*ContentUsage) Descriptor() ([]byte, []int)

Deprecated: Use ContentUsage.ProtoReflect.Descriptor instead.

func (*ContentUsage) GetCompletionTokens

func (x *ContentUsage) GetCompletionTokens() int64

func (*ContentUsage) GetPromptTokens

func (x *ContentUsage) GetPromptTokens() int64

func (*ContentUsage) GetTotalTokens

func (x *ContentUsage) GetTotalTokens() int64

func (*ContentUsage) ProtoMessage

func (*ContentUsage) ProtoMessage()

func (*ContentUsage) ProtoReflect

func (x *ContentUsage) ProtoReflect() protoreflect.Message

func (*ContentUsage) Reset

func (x *ContentUsage) Reset()

func (*ContentUsage) SetCompletionTokens

func (m *ContentUsage) SetCompletionTokens(v int64)

func (*ContentUsage) SetPromptTokens

func (m *ContentUsage) SetPromptTokens(v int64)

func (*ContentUsage) SetTotalTokens

func (m *ContentUsage) SetTotalTokens(v int64)

func (*ContentUsage) String

func (x *ContentUsage) String() string

type CreateRunRequest

type CreateRunRequest struct {

	// ID of the assistant for which the run is being created
	AssistantId string `protobuf:"bytes,1,opt,name=assistant_id,json=assistantId,proto3" json:"assistant_id,omitempty"`
	// ID of the thread associated with the run.
	ThreadId string `protobuf:"bytes,2,opt,name=thread_id,json=threadId,proto3" json:"thread_id,omitempty"`
	// Set of key-value pairs to label the run.
	Labels map[string]string `` /* 153-byte string literal not displayed */
	// Additional messages that will be written to the thread before the run starts.
	AdditionalMessages []*threads.MessageData `protobuf:"bytes,4,rep,name=additional_messages,json=additionalMessages,proto3" json:"additional_messages,omitempty"`
	// Configuration options for truncating the prompt when the token count exceeds a specified limit.
	// If specified, these options will override the assistant's prompt truncation settings for this run.
	CustomPromptTruncationOptions *v1.PromptTruncationOptions `` /* 152-byte string literal not displayed */
	// Configuration options for completion generation.
	// If specified, these options will override the assistant's completion settings for this run.
	CustomCompletionOptions *v1.CompletionOptions `` /* 132-byte string literal not displayed */
	// Enables streaming of intermediate events, such as partial messages.
	Stream bool `protobuf:"varint,7,opt,name=stream,proto3" json:"stream,omitempty"`
	// contains filtered or unexported fields
}

Request message for creating a new run.

func (*CreateRunRequest) Descriptor deprecated

func (*CreateRunRequest) Descriptor() ([]byte, []int)

Deprecated: Use CreateRunRequest.ProtoReflect.Descriptor instead.

func (*CreateRunRequest) GetAdditionalMessages

func (x *CreateRunRequest) GetAdditionalMessages() []*threads.MessageData

func (*CreateRunRequest) GetAssistantId

func (x *CreateRunRequest) GetAssistantId() string

func (*CreateRunRequest) GetCustomCompletionOptions

func (x *CreateRunRequest) GetCustomCompletionOptions() *v1.CompletionOptions

func (*CreateRunRequest) GetCustomPromptTruncationOptions

func (x *CreateRunRequest) GetCustomPromptTruncationOptions() *v1.PromptTruncationOptions

func (*CreateRunRequest) GetLabels

func (x *CreateRunRequest) GetLabels() map[string]string

func (*CreateRunRequest) GetStream

func (x *CreateRunRequest) GetStream() bool

func (*CreateRunRequest) GetThreadId

func (x *CreateRunRequest) GetThreadId() string

func (*CreateRunRequest) ProtoMessage

func (*CreateRunRequest) ProtoMessage()

func (*CreateRunRequest) ProtoReflect

func (x *CreateRunRequest) ProtoReflect() protoreflect.Message

func (*CreateRunRequest) Reset

func (x *CreateRunRequest) Reset()

func (*CreateRunRequest) SetAdditionalMessages

func (m *CreateRunRequest) SetAdditionalMessages(v []*threads.MessageData)

func (*CreateRunRequest) SetAssistantId

func (m *CreateRunRequest) SetAssistantId(v string)

func (*CreateRunRequest) SetCustomCompletionOptions

func (m *CreateRunRequest) SetCustomCompletionOptions(v *v1.CompletionOptions)

func (*CreateRunRequest) SetCustomPromptTruncationOptions

func (m *CreateRunRequest) SetCustomPromptTruncationOptions(v *v1.PromptTruncationOptions)

func (*CreateRunRequest) SetLabels

func (m *CreateRunRequest) SetLabels(v map[string]string)

func (*CreateRunRequest) SetStream

func (m *CreateRunRequest) SetStream(v bool)

func (*CreateRunRequest) SetThreadId

func (m *CreateRunRequest) SetThreadId(v string)

func (*CreateRunRequest) String

func (x *CreateRunRequest) String() string

type GetLastRunByThreadRequest

type GetLastRunByThreadRequest struct {

	// ID of the thread for which the last run is being fetched.
	ThreadId string `protobuf:"bytes,1,opt,name=thread_id,json=threadId,proto3" json:"thread_id,omitempty"`
	// contains filtered or unexported fields
}

Request message for retrieving the last run associated with a specific thread.

func (*GetLastRunByThreadRequest) Descriptor deprecated

func (*GetLastRunByThreadRequest) Descriptor() ([]byte, []int)

Deprecated: Use GetLastRunByThreadRequest.ProtoReflect.Descriptor instead.

func (*GetLastRunByThreadRequest) GetThreadId

func (x *GetLastRunByThreadRequest) GetThreadId() string

func (*GetLastRunByThreadRequest) ProtoMessage

func (*GetLastRunByThreadRequest) ProtoMessage()

func (*GetLastRunByThreadRequest) ProtoReflect

func (*GetLastRunByThreadRequest) Reset

func (x *GetLastRunByThreadRequest) Reset()

func (*GetLastRunByThreadRequest) SetThreadId

func (m *GetLastRunByThreadRequest) SetThreadId(v string)

func (*GetLastRunByThreadRequest) String

func (x *GetLastRunByThreadRequest) String() string

type GetRunRequest

type GetRunRequest struct {

	// ID of the run to retrieve.
	RunId string `protobuf:"bytes,1,opt,name=run_id,json=runId,proto3" json:"run_id,omitempty"`
	// contains filtered or unexported fields
}

Request message for retrieving a specific run by its ID.

func (*GetRunRequest) Descriptor deprecated

func (*GetRunRequest) Descriptor() ([]byte, []int)

Deprecated: Use GetRunRequest.ProtoReflect.Descriptor instead.

func (*GetRunRequest) GetRunId

func (x *GetRunRequest) GetRunId() string

func (*GetRunRequest) ProtoMessage

func (*GetRunRequest) ProtoMessage()

func (*GetRunRequest) ProtoReflect

func (x *GetRunRequest) ProtoReflect() protoreflect.Message

func (*GetRunRequest) Reset

func (x *GetRunRequest) Reset()

func (*GetRunRequest) SetRunId

func (m *GetRunRequest) SetRunId(v string)

func (*GetRunRequest) String

func (x *GetRunRequest) String() string

type ListRunsRequest

type ListRunsRequest struct {

	// Folder ID from which to list runs.
	FolderId string `protobuf:"bytes,1,opt,name=folder_id,json=folderId,proto3" json:"folder_id,omitempty"`
	// Maximum number of threads to return per page.
	PageSize int64 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
	// Token to retrieve the next page of results.
	PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
	// contains filtered or unexported fields
}

Request message for listing runs.

func (*ListRunsRequest) Descriptor deprecated

func (*ListRunsRequest) Descriptor() ([]byte, []int)

Deprecated: Use ListRunsRequest.ProtoReflect.Descriptor instead.

func (*ListRunsRequest) GetFolderId

func (x *ListRunsRequest) GetFolderId() string

func (*ListRunsRequest) GetPageSize

func (x *ListRunsRequest) GetPageSize() int64

func (*ListRunsRequest) GetPageToken

func (x *ListRunsRequest) GetPageToken() string

func (*ListRunsRequest) ProtoMessage

func (*ListRunsRequest) ProtoMessage()

func (*ListRunsRequest) ProtoReflect

func (x *ListRunsRequest) ProtoReflect() protoreflect.Message

func (*ListRunsRequest) Reset

func (x *ListRunsRequest) Reset()

func (*ListRunsRequest) SetFolderId

func (m *ListRunsRequest) SetFolderId(v string)

func (*ListRunsRequest) SetPageSize

func (m *ListRunsRequest) SetPageSize(v int64)

func (*ListRunsRequest) SetPageToken

func (m *ListRunsRequest) SetPageToken(v string)

func (*ListRunsRequest) String

func (x *ListRunsRequest) String() string

type ListRunsResponse

type ListRunsResponse struct {

	// List of runs in the specified folder.
	Runs []*Run `protobuf:"bytes,1,rep,name=runs,proto3" json:"runs,omitempty"`
	// Token to retrieve the next page of results.
	NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
	// contains filtered or unexported fields
}

Response message for the list operation.

func (*ListRunsResponse) Descriptor deprecated

func (*ListRunsResponse) Descriptor() ([]byte, []int)

Deprecated: Use ListRunsResponse.ProtoReflect.Descriptor instead.

func (*ListRunsResponse) GetNextPageToken

func (x *ListRunsResponse) GetNextPageToken() string

func (*ListRunsResponse) GetRuns

func (x *ListRunsResponse) GetRuns() []*Run

func (*ListRunsResponse) ProtoMessage

func (*ListRunsResponse) ProtoMessage()

func (*ListRunsResponse) ProtoReflect

func (x *ListRunsResponse) ProtoReflect() protoreflect.Message

func (*ListRunsResponse) Reset

func (x *ListRunsResponse) Reset()

func (*ListRunsResponse) SetNextPageToken

func (m *ListRunsResponse) SetNextPageToken(v string)

func (*ListRunsResponse) SetRuns

func (m *ListRunsResponse) SetRuns(v []*Run)

func (*ListRunsResponse) String

func (x *ListRunsResponse) String() string

type ListenRunRequest

type ListenRunRequest struct {

	// ID of the run to listen to.
	RunId string `protobuf:"bytes,1,opt,name=run_id,json=runId,proto3" json:"run_id,omitempty"`
	// Starting index for events. If provided, listening will start from this event.
	EventsStartIdx *wrapperspb.Int64Value `protobuf:"bytes,2,opt,name=events_start_idx,json=eventsStartIdx,proto3" json:"events_start_idx,omitempty"`
	// contains filtered or unexported fields
}

Request message for listing to a run events.

func (*ListenRunRequest) Descriptor deprecated

func (*ListenRunRequest) Descriptor() ([]byte, []int)

Deprecated: Use ListenRunRequest.ProtoReflect.Descriptor instead.

func (*ListenRunRequest) GetEventsStartIdx

func (x *ListenRunRequest) GetEventsStartIdx() *wrapperspb.Int64Value

func (*ListenRunRequest) GetRunId

func (x *ListenRunRequest) GetRunId() string

func (*ListenRunRequest) ProtoMessage

func (*ListenRunRequest) ProtoMessage()

func (*ListenRunRequest) ProtoReflect

func (x *ListenRunRequest) ProtoReflect() protoreflect.Message

func (*ListenRunRequest) Reset

func (x *ListenRunRequest) Reset()

func (*ListenRunRequest) SetEventsStartIdx

func (m *ListenRunRequest) SetEventsStartIdx(v *wrapperspb.Int64Value)

func (*ListenRunRequest) SetRunId

func (m *ListenRunRequest) SetRunId(v string)

func (*ListenRunRequest) String

func (x *ListenRunRequest) String() string

type Run

type Run struct {

	// Unique identifier of the run.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// Identifier for the assistant that is being run.
	AssistantId string `protobuf:"bytes,2,opt,name=assistant_id,json=assistantId,proto3" json:"assistant_id,omitempty"`
	// Identifier for the thread of messages that this run is associated with.
	ThreadId string `protobuf:"bytes,3,opt,name=thread_id,json=threadId,proto3" json:"thread_id,omitempty"`
	// Identifier of the subject who created this run.
	CreatedBy string `protobuf:"bytes,4,opt,name=created_by,json=createdBy,proto3" json:"created_by,omitempty"`
	// Timestamp representing when the run was created.
	CreatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	// Set of key-value pairs that can be used to organize and categorize the run.
	Labels map[string]string `` /* 153-byte string literal not displayed */
	// Current state of the run, including its status and any associated data.
	State *RunState `protobuf:"bytes,7,opt,name=state,proto3" json:"state,omitempty"`
	// Information about the content usage during the run, such as the number of [tokens](/docs/foundation-models/concepts/yandexgpt/tokens) used by the completion model.
	Usage *ContentUsage `protobuf:"bytes,8,opt,name=usage,proto3" json:"usage,omitempty"`
	// Configuration options for truncating the prompt when the token count exceeds a specified limit.
	// If specified, these options will override the assistant's prompt truncation settings for this run.
	CustomPromptTruncationOptions *v1.PromptTruncationOptions `` /* 152-byte string literal not displayed */
	// Configuration options for completion generation.
	// If specified, these options will override the assistant's completion settings for this run.
	CustomCompletionOptions *v1.CompletionOptions `` /* 133-byte string literal not displayed */
	// contains filtered or unexported fields
}

Represents a run of an assistant over a specific thread of messages.

func (*Run) Descriptor deprecated

func (*Run) Descriptor() ([]byte, []int)

Deprecated: Use Run.ProtoReflect.Descriptor instead.

func (*Run) GetAssistantId

func (x *Run) GetAssistantId() string

func (*Run) GetCreatedAt

func (x *Run) GetCreatedAt() *timestamppb.Timestamp

func (*Run) GetCreatedBy

func (x *Run) GetCreatedBy() string

func (*Run) GetCustomCompletionOptions

func (x *Run) GetCustomCompletionOptions() *v1.CompletionOptions

func (*Run) GetCustomPromptTruncationOptions

func (x *Run) GetCustomPromptTruncationOptions() *v1.PromptTruncationOptions

func (*Run) GetId

func (x *Run) GetId() string

func (*Run) GetLabels

func (x *Run) GetLabels() map[string]string

func (*Run) GetState

func (x *Run) GetState() *RunState

func (*Run) GetThreadId

func (x *Run) GetThreadId() string

func (*Run) GetUsage

func (x *Run) GetUsage() *ContentUsage

func (*Run) ProtoMessage

func (*Run) ProtoMessage()

func (*Run) ProtoReflect

func (x *Run) ProtoReflect() protoreflect.Message

func (*Run) Reset

func (x *Run) Reset()

func (*Run) SetAssistantId

func (m *Run) SetAssistantId(v string)

func (*Run) SetCreatedAt

func (m *Run) SetCreatedAt(v *timestamppb.Timestamp)

func (*Run) SetCreatedBy

func (m *Run) SetCreatedBy(v string)

func (*Run) SetCustomCompletionOptions

func (m *Run) SetCustomCompletionOptions(v *v1.CompletionOptions)

func (*Run) SetCustomPromptTruncationOptions

func (m *Run) SetCustomPromptTruncationOptions(v *v1.PromptTruncationOptions)

func (*Run) SetId

func (m *Run) SetId(v string)

func (*Run) SetLabels

func (m *Run) SetLabels(v map[string]string)

func (*Run) SetState

func (m *Run) SetState(v *RunState)

func (*Run) SetThreadId

func (m *Run) SetThreadId(v string)

func (*Run) SetUsage

func (m *Run) SetUsage(v *ContentUsage)

func (*Run) String

func (x *Run) String() string

type RunServiceClient

type RunServiceClient interface {
	// Create a new run for a given assistant and thread.
	Create(ctx context.Context, in *CreateRunRequest, opts ...grpc.CallOption) (*Run, error)
	// Listen to events from a specific run.
	// If the run was created with `stream = false`, Listen will only respond with the final status of the run
	// and will not stream partial messages or intermediate events.
	Listen(ctx context.Context, in *ListenRunRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[StreamEvent], error)
	// Retrieve details of a specific run by its ID.
	Get(ctx context.Context, in *GetRunRequest, opts ...grpc.CallOption) (*Run, error)
	// Retrieves the most recent run for a specific thread.
	GetLastByThread(ctx context.Context, in *GetLastRunByThreadRequest, opts ...grpc.CallOption) (*Run, error)
	// List runs in a specific folder.
	List(ctx context.Context, in *ListRunsRequest, opts ...grpc.CallOption) (*ListRunsResponse, error)
}

RunServiceClient is the client API for RunService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

RunService provides operations for managing runs.

func NewRunServiceClient

func NewRunServiceClient(cc grpc.ClientConnInterface) RunServiceClient

type RunServiceServer

type RunServiceServer interface {
	// Create a new run for a given assistant and thread.
	Create(context.Context, *CreateRunRequest) (*Run, error)
	// Listen to events from a specific run.
	// If the run was created with `stream = false`, Listen will only respond with the final status of the run
	// and will not stream partial messages or intermediate events.
	Listen(*ListenRunRequest, grpc.ServerStreamingServer[StreamEvent]) error
	// Retrieve details of a specific run by its ID.
	Get(context.Context, *GetRunRequest) (*Run, error)
	// Retrieves the most recent run for a specific thread.
	GetLastByThread(context.Context, *GetLastRunByThreadRequest) (*Run, error)
	// List runs in a specific folder.
	List(context.Context, *ListRunsRequest) (*ListRunsResponse, error)
}

RunServiceServer is the server API for RunService service. All implementations should embed UnimplementedRunServiceServer for forward compatibility.

RunService provides operations for managing runs.

type RunService_ListenClient

type RunService_ListenClient = grpc.ServerStreamingClient[StreamEvent]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type RunService_ListenServer

type RunService_ListenServer = grpc.ServerStreamingServer[StreamEvent]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type RunState

type RunState struct {

	// Current status of a run.
	Status RunState_RunStatus `protobuf:"varint,1,opt,name=status,proto3,enum=yandex.cloud.ai.assistants.v1.runs.RunState_RunStatus" json:"status,omitempty"`
	// Oneof field to capture additional data depending on the state of a run.
	//
	// Types that are assignable to StateData:
	//
	//	*RunState_Error
	//	*RunState_CompletedMessage
	StateData isRunState_StateData `protobuf_oneof:"StateData"`
	// contains filtered or unexported fields
}

Represents the current state of a run.

func (*RunState) Descriptor deprecated

func (*RunState) Descriptor() ([]byte, []int)

Deprecated: Use RunState.ProtoReflect.Descriptor instead.

func (*RunState) GetCompletedMessage

func (x *RunState) GetCompletedMessage() *threads.Message

func (*RunState) GetError

func (x *RunState) GetError() *common.Error

func (*RunState) GetStateData

func (m *RunState) GetStateData() isRunState_StateData

func (*RunState) GetStatus

func (x *RunState) GetStatus() RunState_RunStatus

func (*RunState) ProtoMessage

func (*RunState) ProtoMessage()

func (*RunState) ProtoReflect

func (x *RunState) ProtoReflect() protoreflect.Message

func (*RunState) Reset

func (x *RunState) Reset()

func (*RunState) SetCompletedMessage

func (m *RunState) SetCompletedMessage(v *threads.Message)

func (*RunState) SetError

func (m *RunState) SetError(v *common.Error)

func (*RunState) SetStateData

func (m *RunState) SetStateData(v RunState_StateData)

func (*RunState) SetStatus

func (m *RunState) SetStatus(v RunState_RunStatus)

func (*RunState) String

func (x *RunState) String() string

type RunState_CompletedMessage

type RunState_CompletedMessage struct {
	// Final message generated by an assistant if a run has completed successfully.
	CompletedMessage *threads.Message `protobuf:"bytes,3,opt,name=completed_message,json=completedMessage,proto3,oneof"`
}

type RunState_Error

type RunState_Error struct {
	// Error information if a run has failed.
	Error *common.Error `protobuf:"bytes,2,opt,name=error,proto3,oneof"`
}

type RunState_RunStatus

type RunState_RunStatus int32

Enum representing the status of a run.

const (
	// Default unspecified status.
	RunState_RUN_STATUS_UNSPECIFIED RunState_RunStatus = 0
	// Run has been created but has not started yet.
	RunState_PENDING RunState_RunStatus = 1
	// Run is currently in progress.
	RunState_IN_PROGRESS RunState_RunStatus = 2
	// Run has failed due to an error.
	RunState_FAILED RunState_RunStatus = 3
	// Run has completed successfully.
	RunState_COMPLETED RunState_RunStatus = 4
)

func (RunState_RunStatus) Descriptor

func (RunState_RunStatus) Enum

func (RunState_RunStatus) EnumDescriptor deprecated

func (RunState_RunStatus) EnumDescriptor() ([]byte, []int)

Deprecated: Use RunState_RunStatus.Descriptor instead.

func (RunState_RunStatus) Number

func (RunState_RunStatus) String

func (x RunState_RunStatus) String() string

func (RunState_RunStatus) Type

type RunState_StateData

type RunState_StateData = isRunState_StateData

type StreamCursor

type StreamCursor struct {

	// Index of the current event in the stream.
	CurrentEventIdx int64 `protobuf:"varint,1,opt,name=current_event_idx,json=currentEventIdx,proto3" json:"current_event_idx,omitempty"`
	// The number of user events received so far.
	NumUserEventsReceived int64 `` /* 129-byte string literal not displayed */
	// contains filtered or unexported fields
}

Represents the cursor position in a stream of events.

func (*StreamCursor) Descriptor deprecated

func (*StreamCursor) Descriptor() ([]byte, []int)

Deprecated: Use StreamCursor.ProtoReflect.Descriptor instead.

func (*StreamCursor) GetCurrentEventIdx

func (x *StreamCursor) GetCurrentEventIdx() int64

func (*StreamCursor) GetNumUserEventsReceived

func (x *StreamCursor) GetNumUserEventsReceived() int64

func (*StreamCursor) ProtoMessage

func (*StreamCursor) ProtoMessage()

func (*StreamCursor) ProtoReflect

func (x *StreamCursor) ProtoReflect() protoreflect.Message

func (*StreamCursor) Reset

func (x *StreamCursor) Reset()

func (*StreamCursor) SetCurrentEventIdx

func (m *StreamCursor) SetCurrentEventIdx(v int64)

func (*StreamCursor) SetNumUserEventsReceived

func (m *StreamCursor) SetNumUserEventsReceived(v int64)

func (*StreamCursor) String

func (x *StreamCursor) String() string

type StreamEvent

type StreamEvent struct {

	// The type of event.
	EventType StreamEvent_EventType `` /* 151-byte string literal not displayed */
	// The current position in the stream.
	StreamCursor *StreamCursor `protobuf:"bytes,2,opt,name=stream_cursor,json=streamCursor,proto3" json:"stream_cursor,omitempty"`
	// Event data, which can be one of several types.
	//
	// Types that are assignable to EventData:
	//
	//	*StreamEvent_Error
	//	*StreamEvent_PartialMessage
	//	*StreamEvent_CompletedMessage
	EventData isStreamEvent_EventData `protobuf_oneof:"EventData"`
	// contains filtered or unexported fields
}

Represents an event in the stream of a run.

func (*StreamEvent) Descriptor deprecated

func (*StreamEvent) Descriptor() ([]byte, []int)

Deprecated: Use StreamEvent.ProtoReflect.Descriptor instead.

func (*StreamEvent) GetCompletedMessage

func (x *StreamEvent) GetCompletedMessage() *threads.Message

func (*StreamEvent) GetError

func (x *StreamEvent) GetError() *common.Error

func (*StreamEvent) GetEventData

func (m *StreamEvent) GetEventData() isStreamEvent_EventData

func (*StreamEvent) GetEventType

func (x *StreamEvent) GetEventType() StreamEvent_EventType

func (*StreamEvent) GetPartialMessage

func (x *StreamEvent) GetPartialMessage() *threads.MessageContent

func (*StreamEvent) GetStreamCursor

func (x *StreamEvent) GetStreamCursor() *StreamCursor

func (*StreamEvent) ProtoMessage

func (*StreamEvent) ProtoMessage()

func (*StreamEvent) ProtoReflect

func (x *StreamEvent) ProtoReflect() protoreflect.Message

func (*StreamEvent) Reset

func (x *StreamEvent) Reset()

func (*StreamEvent) SetCompletedMessage

func (m *StreamEvent) SetCompletedMessage(v *threads.Message)

func (*StreamEvent) SetError

func (m *StreamEvent) SetError(v *common.Error)

func (*StreamEvent) SetEventData

func (m *StreamEvent) SetEventData(v StreamEvent_EventData)

func (*StreamEvent) SetEventType

func (m *StreamEvent) SetEventType(v StreamEvent_EventType)

func (*StreamEvent) SetPartialMessage

func (m *StreamEvent) SetPartialMessage(v *threads.MessageContent)

func (*StreamEvent) SetStreamCursor

func (m *StreamEvent) SetStreamCursor(v *StreamCursor)

func (*StreamEvent) String

func (x *StreamEvent) String() string

type StreamEvent_CompletedMessage

type StreamEvent_CompletedMessage struct {
	// Final message generated by an assistant if a run has completed successfully.
	CompletedMessage *threads.Message `protobuf:"bytes,5,opt,name=completed_message,json=completedMessage,proto3,oneof"`
}

type StreamEvent_Error

type StreamEvent_Error struct {
	// Error information if the run has failed.
	Error *common.Error `protobuf:"bytes,3,opt,name=error,proto3,oneof"`
}

type StreamEvent_EventData

type StreamEvent_EventData = isStreamEvent_EventData

type StreamEvent_EventType

type StreamEvent_EventType int32

Enum representing events that can occur in the stream.

const (
	// Unspecified event type.
	StreamEvent_EVENT_TYPE_UNSPECIFIED StreamEvent_EventType = 0
	// Partial message is available.
	StreamEvent_PARTIAL_MESSAGE StreamEvent_EventType = 1
	// Run has failed due to an error.
	StreamEvent_ERROR StreamEvent_EventType = 2
	// The run has completed.
	StreamEvent_DONE StreamEvent_EventType = 3
)

func (StreamEvent_EventType) Descriptor

func (StreamEvent_EventType) Enum

func (StreamEvent_EventType) EnumDescriptor deprecated

func (StreamEvent_EventType) EnumDescriptor() ([]byte, []int)

Deprecated: Use StreamEvent_EventType.Descriptor instead.

func (StreamEvent_EventType) Number

func (StreamEvent_EventType) String

func (x StreamEvent_EventType) String() string

func (StreamEvent_EventType) Type

type StreamEvent_PartialMessage

type StreamEvent_PartialMessage struct {
	// Partially generated message.
	PartialMessage *threads.MessageContent `protobuf:"bytes,4,opt,name=partial_message,json=partialMessage,proto3,oneof"`
}

type UnimplementedRunServiceServer

type UnimplementedRunServiceServer struct{}

UnimplementedRunServiceServer should be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedRunServiceServer) Create

func (UnimplementedRunServiceServer) Get

func (UnimplementedRunServiceServer) GetLastByThread

func (UnimplementedRunServiceServer) List

func (UnimplementedRunServiceServer) Listen

type UnsafeRunServiceServer

type UnsafeRunServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeRunServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to RunServiceServer will result in compilation errors.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL