From 712118f10f1b485cf12aa3694488760bfcb85ddf Mon Sep 17 00:00:00 2001 From: Jordan Oroshiba Date: Mon, 27 Oct 2025 10:55:25 -0700 Subject: [PATCH] chore: isolate internal protos --- buf.yaml | 19 +- .../api/thread/v1alpha1/thread_types.proto | 19 +- .../v1alpha1/llm_response_service.proto | 10 +- .../v1alpha1/llm_response_types.proto | 2 +- .../v1alpha1/thread_context_service.proto | 6 +- .../v1alpha1/thread_context_types.proto | 2 +- .../v1alpha1/tool_execution_service.proto | 11 +- .../v1alpha1/tool_execution_types.proto | 2 +- tim-api/internal/mapper/persona.go | 2 +- tim-api/internal/mapper/thread.go | 2 +- .../services/llm_response/handlers.go | 2 +- .../internal/services/llm_response/service.go | 2 +- .../services/thread_context/handlers.go | 2 +- .../services/thread_context/service.go | 2 +- .../services/tool_execution/handlers.go | 2 +- .../services/tool_execution/service.go | 2 +- tim-proto/gen/openapi.yaml | 337 +----------------- .../v1alpha1/thread_service.swagger.json | 54 +-- .../api/thread/v1alpha1/thread_types.pb.go | 138 +++++-- .../v1alpha1/llm_response_service.pb.go | 108 +++--- .../llm_response_service.swagger.json | 111 ++---- .../v1alpha1/llm_response_types.pb.go | 178 ++++----- .../v1alpha1/llm_response_types.swagger.json | 2 +- .../llm_response_service.connect.go | 32 +- .../v1alpha1/thread_context_service.pb.go | 70 ++-- .../thread_context_service.swagger.json | 92 ++--- .../v1alpha1/thread_context_types.pb.go | 154 ++++---- .../thread_context_types.swagger.json | 2 +- .../thread_context_service.connect.go | 24 +- .../v1alpha1/tool_execution_service.pb.go | 94 ++--- .../tool_execution_service.swagger.json | 124 ++----- .../v1alpha1/tool_execution_types.pb.go | 62 ++-- .../tool_execution_types.swagger.json | 2 +- .../tool_execution_service.connect.go | 30 +- tim-worker/internal/apiclient/client.go | 12 +- tim-worker/internal/apiclient/client_test.go | 2 +- tim-worker/internal/llm_provider/anthropic.go | 2 +- .../internal/llm_provider/anthropic_test.go | 2 +- tim-worker/internal/llm_provider/google.go | 2 +- .../internal/llm_provider/google_test.go | 2 +- tim-worker/internal/llm_provider/openai.go | 2 +- .../internal/llm_provider/openai_test.go | 2 +- tim-worker/internal/llm_provider/provider.go | 2 +- .../internal/worker/handle_count_tokens.go | 2 +- .../internal/worker/handle_llm_relay.go | 4 +- .../internal/worker/handle_llm_relay_test.go | 2 +- 46 files changed, 682 insertions(+), 1055 deletions(-) rename proto/{tim-api/tim/api => tim-internal/tim/int}/llm_response/v1alpha1/llm_response_service.proto (87%) rename proto/{tim-api/tim/api => tim-internal/tim/int}/llm_response/v1alpha1/llm_response_types.proto (99%) rename proto/{tim-api/tim/api => tim-internal/tim/int}/thread_context/v1alpha1/thread_context_service.proto (78%) rename proto/{tim-api/tim/api => tim-internal/tim/int}/thread_context/v1alpha1/thread_context_types.proto (98%) rename proto/{tim-api/tim/api => tim-internal/tim/int}/tool_execution/v1alpha1/tool_execution_service.proto (82%) rename proto/{tim-api/tim/api => tim-internal/tim/int}/tool_execution/v1alpha1/tool_execution_types.proto (96%) rename tim-proto/gen/tim/{api => int}/llm_response/v1alpha1/llm_response_service.pb.go (63%) rename tim-proto/gen/tim/{api => int}/llm_response/v1alpha1/llm_response_service.swagger.json (87%) rename tim-proto/gen/tim/{api => int}/llm_response/v1alpha1/llm_response_types.pb.go (77%) rename tim-proto/gen/tim/{api => int}/llm_response/v1alpha1/llm_response_types.swagger.json (98%) rename tim-proto/gen/tim/{api => int}/llm_response/v1alpha1/llm_responsev1alpha1connect/llm_response_service.connect.go (87%) rename tim-proto/gen/tim/{api => int}/thread_context/v1alpha1/thread_context_service.pb.go (51%) rename tim-proto/gen/tim/{api => int}/thread_context/v1alpha1/thread_context_service.swagger.json (92%) rename tim-proto/gen/tim/{api => int}/thread_context/v1alpha1/thread_context_types.pb.go (75%) rename tim-proto/gen/tim/{api => int}/thread_context/v1alpha1/thread_context_types.swagger.json (98%) rename tim-proto/gen/tim/{api => int}/thread_context/v1alpha1/thread_contextv1alpha1connect/thread_context_service.connect.go (86%) rename tim-proto/gen/tim/{api => int}/tool_execution/v1alpha1/tool_execution_service.pb.go (63%) rename tim-proto/gen/tim/{api => int}/tool_execution/v1alpha1/tool_execution_service.swagger.json (77%) rename tim-proto/gen/tim/{api => int}/tool_execution/v1alpha1/tool_execution_types.pb.go (64%) rename tim-proto/gen/tim/{api => int}/tool_execution/v1alpha1/tool_execution_types.swagger.json (98%) rename tim-proto/gen/tim/{api => int}/tool_execution/v1alpha1/tool_executionv1alpha1connect/tool_execution_service.connect.go (87%) diff --git a/buf.yaml b/buf.yaml index 3e9a59aa6..1d878d63a 100644 --- a/buf.yaml +++ b/buf.yaml @@ -1,7 +1,24 @@ version: v2 modules: - path: proto/tim-api - name: buf.build/greylabs/tim-api + name: buf.build/settlerlabs/tim-api + - path: proto/tim-internal + name: buf.build/settlerlabs/tim-internal + lint: + except: + - FIELD_NOT_REQUIRED + - PACKAGE_NO_IMPORT_CYCLE + - RPC_REQUEST_RESPONSE_UNIQUE + - RPC_RESPONSE_STANDARD_NAME + - AEP_0133_REQUEST_ID_FIELD + - AEP_0134_METHOD_SIGNATURE + - AEP_0134_REQUEST_MASK_REQUIRED + - AEP_0122_KEBAB_CASE_URIS + - AEP_0122_RESOURCE_COLLECTION_IDENTIFIERS + - AEP_0132_RESOURCE_REFERENCE_TYPE + - AEP_0133_RESOURCE_REFERENCE_TYPE + - AEP_0127_HTTP_ANNOTATION + - AEP_0121_RESOURCE_MUST_SUPPORT_LIST deps: - buf.build/googleapis/googleapis - buf.build/bufbuild/protovalidate diff --git a/proto/tim-api/tim/api/thread/v1alpha1/thread_types.proto b/proto/tim-api/tim/api/thread/v1alpha1/thread_types.proto index d843b6245..b19b641e8 100644 --- a/proto/tim-api/tim/api/thread/v1alpha1/thread_types.proto +++ b/proto/tim-api/tim/api/thread/v1alpha1/thread_types.proto @@ -8,7 +8,6 @@ import "google/api/field_behavior.proto"; import "google/api/field_info.proto"; import "google/api/resource.proto"; import "google/protobuf/timestamp.proto"; -import "tim/api/llm_response/v1alpha1/llm_response_types.proto"; import "tim/api/tool/v1alpha1/tool_types.proto"; // Threads are collections of context as events that represent an llm conversation @@ -135,7 +134,7 @@ message LlmMessage { google.protobuf.Timestamp create_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; // Token usage for this message (optional, set after LLM response) - tim.api.llm_response.v1alpha1.TokenUsage token_usage = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + TokenUsage token_usage = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; // Validation rules to ensure that the correct data is set based on the role type option (buf.validate.message).cel = { @@ -229,6 +228,22 @@ message ThreadStateChangeEvent { ThreadLLMState llm_state = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; } +// TokenUsage is the usage of tokens for an llm call. +// This is a user facing version of the internal TokenUsage message +message TokenUsage { + // The number of input tokens. + int64 input_tokens = 1; + + // The number of output tokens. + int64 output_tokens = 2; + + // The number of cache create tokens. + int64 cache_create_tokens = 3; + + // The number of cache read tokens. + int64 cache_read_tokens = 4; +} + // An actor who may participate in creating LLM messages enum LlmMessageRole { // Default unspecified diff --git a/proto/tim-api/tim/api/llm_response/v1alpha1/llm_response_service.proto b/proto/tim-internal/tim/int/llm_response/v1alpha1/llm_response_service.proto similarity index 87% rename from proto/tim-api/tim/api/llm_response/v1alpha1/llm_response_service.proto rename to proto/tim-internal/tim/int/llm_response/v1alpha1/llm_response_service.proto index 614920bab..c0d3715b4 100644 --- a/proto/tim-api/tim/api/llm_response/v1alpha1/llm_response_service.proto +++ b/proto/tim-internal/tim/int/llm_response/v1alpha1/llm_response_service.proto @@ -1,28 +1,22 @@ syntax = "proto3"; -package tim.api.llm_response.v1alpha1; +package tim.int.llm_response.v1alpha1; import "aep/api/field_info.proto"; import "buf/validate/validate.proto"; -import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; -import "tim/api/llm_response/v1alpha1/llm_response_types.proto"; +import "tim/int/llm_response/v1alpha1/llm_response_types.proto"; // LlmResponseService is an internal service for providing llm responses service LlmResponseService { // Upload llm response events to the server // Note: Client streaming RPCs cannot have HTTP annotations with path parameters // This RPC is gRPC-only and excluded from HTTP/REST API generation - // buf:lint:ignore AEP_0127_HTTP_ANNOTATION_REQUIRED rpc UploadLlmResponseEvents(stream UploadLlmResponseEventsRequest) returns (UploadLlmResponseEventsResponse) {} // Provide the token usage for an LLM message rpc PushLlmTokenUsage(PushLlmTokenUsageRequest) returns (PushLlmTokenUsageResponse) { - option (google.api.http) = { - post: "/v1alpha1/{path=orgs/*/users/*/threads/*/messages/*}:usage" - body: "*" - }; option (google.api.method_signature) = "path, token_usage"; } } diff --git a/proto/tim-api/tim/api/llm_response/v1alpha1/llm_response_types.proto b/proto/tim-internal/tim/int/llm_response/v1alpha1/llm_response_types.proto similarity index 99% rename from proto/tim-api/tim/api/llm_response/v1alpha1/llm_response_types.proto rename to proto/tim-internal/tim/int/llm_response/v1alpha1/llm_response_types.proto index aba7646aa..9c7667b6b 100644 --- a/proto/tim-api/tim/api/llm_response/v1alpha1/llm_response_types.proto +++ b/proto/tim-internal/tim/int/llm_response/v1alpha1/llm_response_types.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -package tim.api.llm_response.v1alpha1; +package tim.int.llm_response.v1alpha1; import "buf/validate/validate.proto"; diff --git a/proto/tim-api/tim/api/thread_context/v1alpha1/thread_context_service.proto b/proto/tim-internal/tim/int/thread_context/v1alpha1/thread_context_service.proto similarity index 78% rename from proto/tim-api/tim/api/thread_context/v1alpha1/thread_context_service.proto rename to proto/tim-internal/tim/int/thread_context/v1alpha1/thread_context_service.proto index 53c74258c..98d2742f5 100644 --- a/proto/tim-api/tim/api/thread_context/v1alpha1/thread_context_service.proto +++ b/proto/tim-internal/tim/int/thread_context/v1alpha1/thread_context_service.proto @@ -1,19 +1,17 @@ syntax = "proto3"; -package tim.api.thread_context.v1alpha1; +package tim.int.thread_context.v1alpha1; import "aep/api/field_info.proto"; import "buf/validate/validate.proto"; -import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; -import "tim/api/thread_context/v1alpha1/thread_context_types.proto"; +import "tim/int/thread_context/v1alpha1/thread_context_types.proto"; // ThreadContextService is an internal service for accessing a thread's active context service ThreadContextService { // Get a thread's active context rpc GetThreadContext(GetThreadContextRequest) returns (ThreadContext) { - option (google.api.http) = {get: "/v1alpha1/{path=orgs/*/users/*/threads/*}/context"}; option (google.api.method_signature) = "path"; } } diff --git a/proto/tim-api/tim/api/thread_context/v1alpha1/thread_context_types.proto b/proto/tim-internal/tim/int/thread_context/v1alpha1/thread_context_types.proto similarity index 98% rename from proto/tim-api/tim/api/thread_context/v1alpha1/thread_context_types.proto rename to proto/tim-internal/tim/int/thread_context/v1alpha1/thread_context_types.proto index 64d779da1..765b2d10f 100644 --- a/proto/tim-api/tim/api/thread_context/v1alpha1/thread_context_types.proto +++ b/proto/tim-internal/tim/int/thread_context/v1alpha1/thread_context_types.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -package tim.api.thread_context.v1alpha1; +package tim.int.thread_context.v1alpha1; import "buf/validate/validate.proto"; import "google/protobuf/any.proto"; diff --git a/proto/tim-api/tim/api/tool_execution/v1alpha1/tool_execution_service.proto b/proto/tim-internal/tim/int/tool_execution/v1alpha1/tool_execution_service.proto similarity index 82% rename from proto/tim-api/tim/api/tool_execution/v1alpha1/tool_execution_service.proto rename to proto/tim-internal/tim/int/tool_execution/v1alpha1/tool_execution_service.proto index e2662d5c0..b2843cfd2 100644 --- a/proto/tim-api/tim/api/tool_execution/v1alpha1/tool_execution_service.proto +++ b/proto/tim-internal/tim/int/tool_execution/v1alpha1/tool_execution_service.proto @@ -1,32 +1,25 @@ syntax = "proto3"; -package tim.api.tool_execution.v1alpha1; +package tim.int.tool_execution.v1alpha1; import "aep/api/field_info.proto"; import "buf/validate/validate.proto"; -import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "tim/api/tool/v1alpha1/tool_types.proto"; -import "tim/api/tool_execution/v1alpha1/tool_execution_types.proto"; +import "tim/int/tool_execution/v1alpha1/tool_execution_types.proto"; // ToolExecutionService provides APIs for remote tool execution. // This service is used by workers to fetch and execute tools. // Workers receive tool call IDs via job queue, so List method is not needed. -// buf:lint:ignore AEP_0121_RESOURCE_MUST_SUPPORT_LIST service ToolExecutionService { // Get a specific tool call by its ID rpc GetToolCall(GetToolCallRequest) returns (ToolCall) { - option (google.api.http) = {get: "/v1alpha1/{path=orgs/*/users/*/threads/*/toolCalls/*}"}; option (google.api.method_signature) = "path"; } // Submit a tool execution result rpc SubmitToolResult(SubmitToolResultRequest) returns (SubmitToolResultResponse) { - option (google.api.http) = { - post: "/v1alpha1/{path=orgs/*/users/*/threads/*/toolCalls/*}:submit" - body: "tool_result" - }; option (google.api.method_signature) = "path,tool_result"; } } diff --git a/proto/tim-api/tim/api/tool_execution/v1alpha1/tool_execution_types.proto b/proto/tim-internal/tim/int/tool_execution/v1alpha1/tool_execution_types.proto similarity index 96% rename from proto/tim-api/tim/api/tool_execution/v1alpha1/tool_execution_types.proto rename to proto/tim-internal/tim/int/tool_execution/v1alpha1/tool_execution_types.proto index 9ecbec395..e1a33145c 100644 --- a/proto/tim-api/tim/api/tool_execution/v1alpha1/tool_execution_types.proto +++ b/proto/tim-internal/tim/int/tool_execution/v1alpha1/tool_execution_types.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -package tim.api.tool_execution.v1alpha1; +package tim.int.tool_execution.v1alpha1; import "buf/validate/validate.proto"; import "google/api/field_behavior.proto"; diff --git a/tim-api/internal/mapper/persona.go b/tim-api/internal/mapper/persona.go index dfdfc7c1d..e8aa7712d 100644 --- a/tim-api/internal/mapper/persona.go +++ b/tim-api/internal/mapper/persona.go @@ -4,7 +4,7 @@ import ( "github.com/Greybox-Labs/tim/tim-api/internal/resourcepath" "github.com/Greybox-Labs/tim/tim-db/gen/db" personav1 "github.com/Greybox-Labs/tim/tim-proto/gen/tim/api/persona/v1alpha1" - threadcontextv1 "github.com/Greybox-Labs/tim/tim-proto/gen/tim/api/thread_context/v1alpha1" + threadcontextv1 "github.com/Greybox-Labs/tim/tim-proto/gen/tim/int/thread_context/v1alpha1" "github.com/jackc/pgx/v5/pgtype" "google.golang.org/protobuf/types/known/timestamppb" ) diff --git a/tim-api/internal/mapper/thread.go b/tim-api/internal/mapper/thread.go index 80ed8b75b..8a58ce86d 100644 --- a/tim-api/internal/mapper/thread.go +++ b/tim-api/internal/mapper/thread.go @@ -10,8 +10,8 @@ import ( "github.com/Greybox-Labs/tim/tim-api/internal/resourcepath" "github.com/Greybox-Labs/tim/tim-db/gen/db" threadv1 "github.com/Greybox-Labs/tim/tim-proto/gen/tim/api/thread/v1alpha1" - threadcontextv1 "github.com/Greybox-Labs/tim/tim-proto/gen/tim/api/thread_context/v1alpha1" toolv1 "github.com/Greybox-Labs/tim/tim-proto/gen/tim/api/tool/v1alpha1" + threadcontextv1 "github.com/Greybox-Labs/tim/tim-proto/gen/tim/int/thread_context/v1alpha1" "google.golang.org/protobuf/types/known/timestamppb" ) diff --git a/tim-api/internal/services/llm_response/handlers.go b/tim-api/internal/services/llm_response/handlers.go index 15b593047..a239f8867 100644 --- a/tim-api/internal/services/llm_response/handlers.go +++ b/tim-api/internal/services/llm_response/handlers.go @@ -16,7 +16,7 @@ import ( "github.com/Greybox-Labs/tim/tim-api/internal/pgnotifier" "github.com/Greybox-Labs/tim/tim-api/internal/resourcepath" "github.com/Greybox-Labs/tim/tim-db/gen/db" - llmresponsev1 "github.com/Greybox-Labs/tim/tim-proto/gen/tim/api/llm_response/v1alpha1" + llmresponsev1 "github.com/Greybox-Labs/tim/tim-proto/gen/tim/int/llm_response/v1alpha1" "github.com/google/uuid" "github.com/jackc/pgx/v5/pgtype" ) diff --git a/tim-api/internal/services/llm_response/service.go b/tim-api/internal/services/llm_response/service.go index 7d3a17b23..cbcc53ee5 100644 --- a/tim-api/internal/services/llm_response/service.go +++ b/tim-api/internal/services/llm_response/service.go @@ -9,7 +9,7 @@ import ( "github.com/Greybox-Labs/tim/tim-api/internal/database" "github.com/Greybox-Labs/tim/tim-api/internal/job_queue" apitools "github.com/Greybox-Labs/tim/tim-api/internal/tools" - "github.com/Greybox-Labs/tim/tim-proto/gen/tim/api/llm_response/v1alpha1/llm_responsev1alpha1connect" + "github.com/Greybox-Labs/tim/tim-proto/gen/tim/int/llm_response/v1alpha1/llm_responsev1alpha1connect" ) const ResourceType = "llm_response" diff --git a/tim-api/internal/services/thread_context/handlers.go b/tim-api/internal/services/thread_context/handlers.go index c7d001d47..34d71df96 100644 --- a/tim-api/internal/services/thread_context/handlers.go +++ b/tim-api/internal/services/thread_context/handlers.go @@ -11,7 +11,7 @@ import ( "github.com/Greybox-Labs/tim/tim-api/internal/resourcepath" "github.com/Greybox-Labs/tim/tim-db/gen/db" threadv1 "github.com/Greybox-Labs/tim/tim-proto/gen/tim/api/thread/v1alpha1" - threadcontextv1 "github.com/Greybox-Labs/tim/tim-proto/gen/tim/api/thread_context/v1alpha1" + threadcontextv1 "github.com/Greybox-Labs/tim/tim-proto/gen/tim/int/thread_context/v1alpha1" ) func (s *Service) GetThreadContext( diff --git a/tim-api/internal/services/thread_context/service.go b/tim-api/internal/services/thread_context/service.go index d8a79dc20..10f5eb950 100644 --- a/tim-api/internal/services/thread_context/service.go +++ b/tim-api/internal/services/thread_context/service.go @@ -5,7 +5,7 @@ import ( "connectrpc.com/connect" "github.com/Greybox-Labs/tim/shared/logger" - "github.com/Greybox-Labs/tim/tim-proto/gen/tim/api/thread_context/v1alpha1/thread_contextv1alpha1connect" + "github.com/Greybox-Labs/tim/tim-proto/gen/tim/int/thread_context/v1alpha1/thread_contextv1alpha1connect" ) const ResourceType = "thread_context" diff --git a/tim-api/internal/services/tool_execution/handlers.go b/tim-api/internal/services/tool_execution/handlers.go index c38205a87..1bd34b88a 100644 --- a/tim-api/internal/services/tool_execution/handlers.go +++ b/tim-api/internal/services/tool_execution/handlers.go @@ -16,7 +16,7 @@ import ( "github.com/Greybox-Labs/tim/tim-api/internal/resourcepath" "github.com/Greybox-Labs/tim/tim-db/gen/db" toolv1 "github.com/Greybox-Labs/tim/tim-proto/gen/tim/api/tool/v1alpha1" - tool_executionv1 "github.com/Greybox-Labs/tim/tim-proto/gen/tim/api/tool_execution/v1alpha1" + tool_executionv1 "github.com/Greybox-Labs/tim/tim-proto/gen/tim/int/tool_execution/v1alpha1" "github.com/jackc/pgx/v5/pgtype" "google.golang.org/protobuf/types/known/timestamppb" ) diff --git a/tim-api/internal/services/tool_execution/service.go b/tim-api/internal/services/tool_execution/service.go index 9989a52ae..46f9a99cf 100644 --- a/tim-api/internal/services/tool_execution/service.go +++ b/tim-api/internal/services/tool_execution/service.go @@ -6,7 +6,7 @@ import ( "connectrpc.com/connect" "github.com/Greybox-Labs/tim/shared/logger" "github.com/Greybox-Labs/tim/tim-api/internal/job_queue" - "github.com/Greybox-Labs/tim/tim-proto/gen/tim/api/tool_execution/v1alpha1/tool_executionv1alpha1connect" + "github.com/Greybox-Labs/tim/tim-proto/gen/tim/int/tool_execution/v1alpha1/tool_executionv1alpha1connect" ) const ResourceType = "tool-call" diff --git a/tim-proto/gen/openapi.yaml b/tim-proto/gen/openapi.yaml index e75c88e32..b670cde54 100644 --- a/tim-proto/gen/openapi.yaml +++ b/tim-proto/gen/openapi.yaml @@ -1534,44 +1534,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - /v1alpha1/orgs/{org}/users/{user}/threads/{thread}/context: - get: - tags: - - ThreadContextService - description: Get a thread's active context - operationId: ThreadContextService_GetThreadContext - parameters: - - name: org - in: path - description: The org id. - required: true - schema: - type: string - - name: user - in: path - description: The user id. - required: true - schema: - type: string - - name: thread - in: path - description: The thread id. - required: true - schema: - type: string - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/ThreadContext' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' /v1alpha1/orgs/{org}/users/{user}/threads/{thread}/messages: get: tags: @@ -1667,56 +1629,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - /v1alpha1/orgs/{org}/users/{user}/threads/{thread}/messages/{message}:usage: - post: - tags: - - LlmResponseService - description: Provide the token usage for an LLM message - operationId: LlmResponseService_PushLlmTokenUsage - parameters: - - name: org - in: path - description: The org id. - required: true - schema: - type: string - - name: user - in: path - description: The user id. - required: true - schema: - type: string - - name: thread - in: path - description: The thread id. - required: true - schema: - type: string - - name: message - in: path - description: The message id. - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PushLlmTokenUsageRequest' - required: true - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/PushLlmTokenUsageResponse' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' /v1alpha1/orgs/{org}/users/{user}/threads/{thread}/messages:submitUserMessage: post: tags: @@ -1993,100 +1905,6 @@ paths: application/json: schema: $ref: '#/components/schemas/Status' - /v1alpha1/orgs/{org}/users/{user}/threads/{thread}/toolCalls/{toolCall}: - get: - tags: - - ToolExecutionService - description: Get a specific tool call by its ID - operationId: ToolExecutionService_GetToolCall - parameters: - - name: org - in: path - description: The org id. - required: true - schema: - type: string - - name: user - in: path - description: The user id. - required: true - schema: - type: string - - name: thread - in: path - description: The thread id. - required: true - schema: - type: string - - name: toolCall - in: path - description: The toolCall id. - required: true - schema: - type: string - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/ToolCall' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' - /v1alpha1/orgs/{org}/users/{user}/threads/{thread}/toolCalls/{toolCall}:submit: - post: - tags: - - ToolExecutionService - description: Submit a tool execution result - operationId: ToolExecutionService_SubmitToolResult - parameters: - - name: org - in: path - description: The org id. - required: true - schema: - type: string - - name: user - in: path - description: The user id. - required: true - schema: - type: string - - name: thread - in: path - description: The thread id. - required: true - schema: - type: string - - name: toolCall - in: path - description: The toolCall id. - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ToolResult' - required: true - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/SubmitToolResultResponse' - default: - description: Default error response - content: - application/json: - schema: - $ref: '#/components/schemas/Status' /v1alpha1/orgs/{org}/users/{user}/threads/{thread}:fork: post: tags: @@ -3257,24 +3075,6 @@ components: type: string description: URL to return to if checkout is canceled description: PurchaseCreditPackRequest is the request for purchasing a credit pack - PushLlmTokenUsageRequest: - required: - - path - - tokenUsage - type: object - properties: - path: - type: string - description: The resource path of the message - tokenUsage: - allOf: - - $ref: '#/components/schemas/TokenUsage' - description: The token usage - description: PushLlmTokenUsageRequest is used to post the token usage for an LLM message - PushLlmTokenUsageResponse: - type: object - properties: {} - description: PushLlmTokenUsageResponse is the response for posting the token usage for an LLM message ResolvedPersonaRevision: type: object properties: @@ -3391,19 +3191,6 @@ components: - $ref: '#/components/schemas/ThreadStateChangeEvent' description: The thread's LLM processing state has changed (IDLE or PROCESSING) description: StreamThreadEventsResponse streams content events, tool calls, and thread state changes - SubmitToolResultResponse: - type: object - properties: - message: - type: string - description: The resource path to the message created with the tool result - content: - type: string - description: The resource path to the content block containing the tool result - toolCallId: - type: string - description: The tool call ID that was completed - description: Response after submitting a tool result Subscription: type: object properties: @@ -3535,47 +3322,6 @@ components: description: The current LLM processing state of the thread format: enum description: Threads are collections of context as events that represent an llm conversation - ThreadContext: - type: object - properties: - model: - type: string - description: The model the thread is currently using - maxTokens: - type: string - description: The maximum number of tokens the thread can use - temperature: - type: number - description: The temperature the thread is currently using - format: float - systemPrompts: - type: array - items: - type: string - description: System prompts for the thread - messages: - type: array - items: - $ref: '#/components/schemas/LlmMessage' - description: Messages in the thread - tools: - type: array - items: - type: string - description: |- - Tool names the thread has access to - The worker loads actual tool implementations to get schemas - toolChoice: - allOf: - - $ref: '#/components/schemas/ToolChoice' - description: The thread's tool choice mode - thinking: - type: boolean - description: Whether the thread is using thinking - interleavedThinking: - type: boolean - description: Whether the thread is using interleaved thinking (not supported by all providers) - description: ThreadContext is a collection of active context for a thread ThreadStateChangeEvent: type: object properties: @@ -3664,68 +3410,29 @@ components: cacheReadTokens: type: string description: The number of cache read tokens. - description: TokenUsage is the usage of tokens for an llm call. + description: |- + TokenUsage is the usage of tokens for an llm call. + This is a user facing version of the internal TokenUsage message ToolCall: type: object properties: - id: - type: string - description: Unique identifier for this tool call - name: - type: string - description: Name of the tool being called (e.g., "file_read", "exec_command", "clarify") - input: - type: object - description: JSON-encoded input parameters for the tool - providerToolCallId: + path: + readOnly: true type: string - description: Provider tool call ID (the ID assigned by the LLM provider for this tool call) - description: ToolCall represents a call to a specific tool with its corresponding input parameters. - ToolChoice: - type: object - properties: - auto: - allOf: - - $ref: '#/components/schemas/ToolChoiceAuto' - description: Tool choice should be automatically determined - required: - allOf: - - $ref: '#/components/schemas/ToolChoiceRequired' - description: Tool use is required - tool: - allOf: - - $ref: '#/components/schemas/ToolChoiceTool' - description: A specific tool is required to be used - none: + description: |- + The resource path of the tool call + Format: orgs/{org}/users/{user}/threads/{thread}/toolCalls/{tool_call_id} + toolCall: + readOnly: true allOf: - - $ref: '#/components/schemas/ToolChoiceNone' - description: No tools should be used - description: A tool choice mode - ToolChoiceAuto: - type: object - properties: - parallelToolUse: - type: boolean - description: Whether parallel tool use is allowed. - description: Tool choice should be automatically determined. - ToolChoiceNone: - type: object - properties: {} - description: No tools should be used. - ToolChoiceRequired: - type: object - properties: - parallelToolUse: - type: boolean - description: Whether parallel tool use is allowed. - description: Tool use is required. - ToolChoiceTool: - type: object - properties: - tool: + - $ref: '#/components/schemas/ToolCall' + description: The tool call details (includes the tool_call.id, name, and input) + createTime: + readOnly: true type: string - description: The name of the tool that is required to be used (e.g. "clarify", "file_read") - description: A specific tool is required to be used. + description: When the tool call was created + format: date-time + description: ToolCall represents a tool call that needs to be executed ToolResult: type: object properties: @@ -3834,23 +3541,13 @@ tags: description: |- IdentityService handles authentication and user identity resolution This is a bootstrap service that doesn't require users to exist in the database - - name: LlmResponseService - description: LlmResponseService is an internal service for providing llm responses - name: OrganizationService description: OrganizationService is the service for managing organizations - name: PersonaService description: PersonaService defines the APIs for managing personas - - name: ThreadContextService - description: ThreadContextService is an internal service for accessing a thread's active context - name: ThreadService description: ThreadService defines the thread related APIs. - name: TodoService description: TodoService provides APIs for managing todos in threads - - name: ToolExecutionService - description: |- - ToolExecutionService provides APIs for remote tool execution. - This service is used by workers to fetch and execute tools. - Workers receive tool call IDs via job queue, so List method is not needed. - buf:lint:ignore AEP_0121_RESOURCE_MUST_SUPPORT_LIST - name: UserService description: UserService is the service for managing users within orgs diff --git a/tim-proto/gen/tim/api/thread/v1alpha1/thread_service.swagger.json b/tim-proto/gen/tim/api/thread/v1alpha1/thread_service.swagger.json index bb779603f..681332bc3 100644 --- a/tim-proto/gen/tim/api/thread/v1alpha1/thread_service.swagger.json +++ b/tim-proto/gen/tim/api/thread/v1alpha1/thread_service.swagger.json @@ -430,6 +430,32 @@ "beforeTime" ] }, + "apithreadv1alpha1TokenUsage": { + "type": "object", + "properties": { + "inputTokens": { + "type": "string", + "format": "int64", + "description": "The number of input tokens." + }, + "outputTokens": { + "type": "string", + "format": "int64", + "description": "The number of output tokens." + }, + "cacheCreateTokens": { + "type": "string", + "format": "int64", + "description": "The number of cache create tokens." + }, + "cacheReadTokens": { + "type": "string", + "format": "int64", + "description": "The number of cache read tokens." + } + }, + "title": "TokenUsage is the usage of tokens for an llm call.\nThis is a user facing version of the internal TokenUsage message" + }, "apitoolv1alpha1ToolCall": { "type": "object", "properties": { @@ -653,7 +679,7 @@ "readOnly": true }, "tokenUsage": { - "$ref": "#/definitions/v1alpha1TokenUsage", + "$ref": "#/definitions/apithreadv1alpha1TokenUsage", "title": "Token usage for this message (optional, set after LLM response)", "readOnly": true } @@ -816,32 +842,6 @@ }, "title": "ThreadStateChangeEvent notifies when thread LLM state changes" }, - "v1alpha1TokenUsage": { - "type": "object", - "properties": { - "inputTokens": { - "type": "string", - "format": "int64", - "description": "The number of input tokens." - }, - "outputTokens": { - "type": "string", - "format": "int64", - "description": "The number of output tokens." - }, - "cacheCreateTokens": { - "type": "string", - "format": "int64", - "description": "The number of cache create tokens." - }, - "cacheReadTokens": { - "type": "string", - "format": "int64", - "description": "The number of cache read tokens." - } - }, - "description": "TokenUsage is the usage of tokens for an llm call." - }, "v1alpha1ToolResult": { "type": "object", "properties": { diff --git a/tim-proto/gen/tim/api/thread/v1alpha1/thread_types.pb.go b/tim-proto/gen/tim/api/thread/v1alpha1/thread_types.pb.go index a9eb2c114..6873654a9 100644 --- a/tim-proto/gen/tim/api/thread/v1alpha1/thread_types.pb.go +++ b/tim-proto/gen/tim/api/thread/v1alpha1/thread_types.pb.go @@ -9,8 +9,7 @@ package threadv1alpha1 import ( _ "buf.build/gen/go/aep/api/protocolbuffers/go/aep/api" _ "buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate" - v1alpha1 "github.com/Greybox-Labs/tim/tim-proto/gen/tim/api/llm_response/v1alpha1" - v1alpha11 "github.com/Greybox-Labs/tim/tim-proto/gen/tim/api/tool/v1alpha1" + v1alpha1 "github.com/Greybox-Labs/tim/tim-proto/gen/tim/api/tool/v1alpha1" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" @@ -323,7 +322,7 @@ type LlmMessage struct { // System set at creation time CreateTime *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` // Token usage for this message (optional, set after LLM response) - TokenUsage *v1alpha1.TokenUsage `protobuf:"bytes,10,opt,name=token_usage,json=tokenUsage,proto3" json:"token_usage,omitempty"` + TokenUsage *TokenUsage `protobuf:"bytes,10,opt,name=token_usage,json=tokenUsage,proto3" json:"token_usage,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -421,7 +420,7 @@ func (x *LlmMessage) GetCreateTime() *timestamppb.Timestamp { return nil } -func (x *LlmMessage) GetTokenUsage() *v1alpha1.TokenUsage { +func (x *LlmMessage) GetTokenUsage() *TokenUsage { if x != nil { return x.TokenUsage } @@ -573,7 +572,7 @@ func (x *LlmMessageContent) GetThinking() *Thinking { return nil } -func (x *LlmMessageContent) GetToolCall() *v1alpha11.ToolCall { +func (x *LlmMessageContent) GetToolCall() *v1alpha1.ToolCall { if x != nil { if x, ok := x.Data.(*LlmMessageContent_ToolCall); ok { return x.ToolCall @@ -582,7 +581,7 @@ func (x *LlmMessageContent) GetToolCall() *v1alpha11.ToolCall { return nil } -func (x *LlmMessageContent) GetToolResult() *v1alpha11.ToolResult { +func (x *LlmMessageContent) GetToolResult() *v1alpha1.ToolResult { if x != nil { if x, ok := x.Data.(*LlmMessageContent_ToolResult); ok { return x.ToolResult @@ -614,12 +613,12 @@ type LlmMessageContent_Thinking struct { type LlmMessageContent_ToolCall struct { // A tool call made by the model - ToolCall *v1alpha11.ToolCall `protobuf:"bytes,5,opt,name=tool_call,json=toolCall,proto3,oneof"` + ToolCall *v1alpha1.ToolCall `protobuf:"bytes,5,opt,name=tool_call,json=toolCall,proto3,oneof"` } type LlmMessageContent_ToolResult struct { // The result of a tool call, created internally by the system after a tool call is made. - ToolResult *v1alpha11.ToolResult `protobuf:"bytes,6,opt,name=tool_result,json=toolResult,proto3,oneof"` + ToolResult *v1alpha1.ToolResult `protobuf:"bytes,6,opt,name=tool_result,json=toolResult,proto3,oneof"` } func (*LlmMessageContent_Text) isLlmMessageContent_Data() {} @@ -841,6 +840,80 @@ func (x *ThreadStateChangeEvent) GetLlmState() ThreadLLMState { return ThreadLLMState_THREAD_LLM_STATE_UNSPECIFIED } +// TokenUsage is the usage of tokens for an llm call. +// This is a user facing version of the internal TokenUsage message +type TokenUsage struct { + state protoimpl.MessageState `protogen:"open.v1"` + // The number of input tokens. + InputTokens int64 `protobuf:"varint,1,opt,name=input_tokens,json=inputTokens,proto3" json:"input_tokens,omitempty"` + // The number of output tokens. + OutputTokens int64 `protobuf:"varint,2,opt,name=output_tokens,json=outputTokens,proto3" json:"output_tokens,omitempty"` + // The number of cache create tokens. + CacheCreateTokens int64 `protobuf:"varint,3,opt,name=cache_create_tokens,json=cacheCreateTokens,proto3" json:"cache_create_tokens,omitempty"` + // The number of cache read tokens. + CacheReadTokens int64 `protobuf:"varint,4,opt,name=cache_read_tokens,json=cacheReadTokens,proto3" json:"cache_read_tokens,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TokenUsage) Reset() { + *x = TokenUsage{} + mi := &file_tim_api_thread_v1alpha1_thread_types_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TokenUsage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TokenUsage) ProtoMessage() {} + +func (x *TokenUsage) ProtoReflect() protoreflect.Message { + mi := &file_tim_api_thread_v1alpha1_thread_types_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TokenUsage.ProtoReflect.Descriptor instead. +func (*TokenUsage) Descriptor() ([]byte, []int) { + return file_tim_api_thread_v1alpha1_thread_types_proto_rawDescGZIP(), []int{8} +} + +func (x *TokenUsage) GetInputTokens() int64 { + if x != nil { + return x.InputTokens + } + return 0 +} + +func (x *TokenUsage) GetOutputTokens() int64 { + if x != nil { + return x.OutputTokens + } + return 0 +} + +func (x *TokenUsage) GetCacheCreateTokens() int64 { + if x != nil { + return x.CacheCreateTokens + } + return 0 +} + +func (x *TokenUsage) GetCacheReadTokens() int64 { + if x != nil { + return x.CacheReadTokens + } + return 0 +} + // The identifier for the original thread this thread was forked from. type Thread_ParentThreadId struct { state protoimpl.MessageState `protogen:"open.v1"` @@ -856,7 +929,7 @@ type Thread_ParentThreadId struct { func (x *Thread_ParentThreadId) Reset() { *x = Thread_ParentThreadId{} - mi := &file_tim_api_thread_v1alpha1_thread_types_proto_msgTypes[8] + mi := &file_tim_api_thread_v1alpha1_thread_types_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -868,7 +941,7 @@ func (x *Thread_ParentThreadId) String() string { func (*Thread_ParentThreadId) ProtoMessage() {} func (x *Thread_ParentThreadId) ProtoReflect() protoreflect.Message { - mi := &file_tim_api_thread_v1alpha1_thread_types_proto_msgTypes[8] + mi := &file_tim_api_thread_v1alpha1_thread_types_proto_msgTypes[9] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -902,7 +975,7 @@ var File_tim_api_thread_v1alpha1_thread_types_proto protoreflect.FileDescriptor const file_tim_api_thread_v1alpha1_thread_types_proto_rawDesc = "" + "\n" + - "*tim/api/thread/v1alpha1/thread_types.proto\x12\x17tim.api.thread.v1alpha1\x1a\x18aep/api/field_info.proto\x1a\x1bbuf/validate/validate.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/api/field_info.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a6tim/api/llm_response/v1alpha1/llm_response_types.proto\x1a&tim/api/tool/v1alpha1/tool_types.proto\"\x83\a\n" + + "*tim/api/thread/v1alpha1/thread_types.proto\x12\x17tim.api.thread.v1alpha1\x1a\x18aep/api/field_info.proto\x1a\x1bbuf/validate/validate.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/api/field_info.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a&tim/api/tool/v1alpha1/tool_types.proto\"\x83\a\n" + "\x06Thread\x12h\n" + "\x04path\x18\x01 \x01(\tBT\xe0A\x03\xbaHN\xd8\x01\x01rI2G^orgs/[a-fA-F0-9-]{36}/users/[a-fA-F0-9-]{36}/threads/[a-fA-F0-9-]{36}$R\x04path\x12+\n" + "\fdisplay_name\x18\x02 \x01(\tB\b\xbaH\x05r\x03\x18\xff\x01R\vdisplayName\x12]\n" + @@ -919,7 +992,8 @@ const file_tim_api_thread_v1alpha1_thread_types_proto_rawDesc = "" + "\x04path\x18\x01 \x01(\tBq\xe0A\x05\xbaHKrI2G^orgs/[a-fA-F0-9-]{36}/users/[a-fA-F0-9-]{36}/threads/[a-fA-F0-9-]{36}$\u0091\x05\x1c\x12\x1atim.settlerlabs.com/ThreadR\x04path\x12F\n" + "\vbefore_time\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampB\t\xe0A\x05\xbaH\x03\xc8\x01\x01R\n" + "beforeTime:Z\xeaAW\n" + - "\x1atim.settlerlabs.com/thread\x12(orgs/{org}/users/{user}/threads/{thread}*\athreads2\x06thread\"\x81\v\n" + + "\x1atim.settlerlabs.com/thread\x12(orgs/{org}/users/{user}/threads/{thread}*\athreads2\x06thread\"\xfb\n" + + "\n" + "\n" + "LlmMessage\x12\x82\x01\n" + "\x04path\x18\x01 \x01(\tBn\xe0A\x03\xbaHh\xd8\x01\x01rc2a^orgs/[a-fA-F0-9-]{36}/users/[a-fA-F0-9-]{36}/threads/[a-fA-F0-9-]{36}/messages/[a-fA-F0-9-]{36}$R\x04path\x12\x99\x01\n" + @@ -931,9 +1005,9 @@ const file_tim_api_thread_v1alpha1_thread_types_proto_rawDesc = "" + "\x18use_interleaved_thinking\x18\a \x01(\bR\x16useInterleavedThinking\x12S\n" + "\bcontents\x18\b \x03(\v2*.tim.api.thread.v1alpha1.LlmMessageContentB\v\xbaH\b\xc8\x01\x01\x92\x01\x02\b\x01R\bcontents\x12@\n" + "\vcreate_time\x18\t \x01(\v2\x1a.google.protobuf.TimestampB\x03\xe0A\x03R\n" + - "createTime\x12O\n" + + "createTime\x12I\n" + "\vtoken_usage\x18\n" + - " \x01(\v2).tim.api.llm_response.v1alpha1.TokenUsageB\x03\xe0A\x03R\n" + + " \x01(\v2#.tim.api.thread.v1alpha1.TokenUsageB\x03\xe0A\x03R\n" + "tokenUsage:\x80\x05\xeaAy\n" + "\x1ftim.settlerlabs.com/llm-message\x12;orgs/{org}/users/{user}/threads/{thread}/messages/{message}*\fllm-messages2\vllm-message\xbaH\x80\x04\x1a\xe9\x01\n" + ")llm-message.role.valid_data_for_user_role\x12.users can only create text or tool_result data\x1a\x8b\x01this.role == tim.api.thread.v1alpha1.LlmMessageRole.LLM_MESSAGE_ROLE_USER? this.contents.exists(c, has(c.text) || has(c.tool_result)): true\x1a\x91\x02\n" + @@ -963,7 +1037,13 @@ const file_tim_api_thread_v1alpha1_thread_types_proto_rawDesc = "" + "\x10ContentStopEvent\x12\x18\n" + "\x02id\x18\x01 \x01(\tB\b\xe2\x8c\xcf\xd7\b\x02\b\x01R\x02id\"c\n" + "\x16ThreadStateChangeEvent\x12I\n" + - "\tllm_state\x18\x01 \x01(\x0e2'.tim.api.thread.v1alpha1.ThreadLLMStateB\x03\xe0A\x03R\bllmState*m\n" + + "\tllm_state\x18\x01 \x01(\x0e2'.tim.api.thread.v1alpha1.ThreadLLMStateB\x03\xe0A\x03R\bllmState\"\xb0\x01\n" + + "\n" + + "TokenUsage\x12!\n" + + "\finput_tokens\x18\x01 \x01(\x03R\vinputTokens\x12#\n" + + "\routput_tokens\x18\x02 \x01(\x03R\foutputTokens\x12.\n" + + "\x13cache_create_tokens\x18\x03 \x01(\x03R\x11cacheCreateTokens\x12*\n" + + "\x11cache_read_tokens\x18\x04 \x01(\x03R\x0fcacheReadTokens*m\n" + "\x0eLlmMessageRole\x12 \n" + "\x1cLLM_MESSAGE_ROLE_UNSPECIFIED\x10\x00\x12\x19\n" + "\x15LLM_MESSAGE_ROLE_USER\x10\x01\x12\x1e\n" + @@ -991,7 +1071,7 @@ func file_tim_api_thread_v1alpha1_thread_types_proto_rawDescGZIP() []byte { } var file_tim_api_thread_v1alpha1_thread_types_proto_enumTypes = make([]protoimpl.EnumInfo, 3) -var file_tim_api_thread_v1alpha1_thread_types_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_tim_api_thread_v1alpha1_thread_types_proto_msgTypes = make([]protoimpl.MessageInfo, 10) var file_tim_api_thread_v1alpha1_thread_types_proto_goTypes = []any{ (LlmMessageRole)(0), // 0: tim.api.thread.v1alpha1.LlmMessageRole (ThreadLLMState)(0), // 1: tim.api.thread.v1alpha1.ThreadLLMState @@ -1004,29 +1084,29 @@ var file_tim_api_thread_v1alpha1_thread_types_proto_goTypes = []any{ (*ContentDeltaEvent)(nil), // 8: tim.api.thread.v1alpha1.ContentDeltaEvent (*ContentStopEvent)(nil), // 9: tim.api.thread.v1alpha1.ContentStopEvent (*ThreadStateChangeEvent)(nil), // 10: tim.api.thread.v1alpha1.ThreadStateChangeEvent - (*Thread_ParentThreadId)(nil), // 11: tim.api.thread.v1alpha1.Thread.ParentThreadId - (*timestamppb.Timestamp)(nil), // 12: google.protobuf.Timestamp - (*v1alpha1.TokenUsage)(nil), // 13: tim.api.llm_response.v1alpha1.TokenUsage - (*v1alpha11.ToolCall)(nil), // 14: tim.api.tool.v1alpha1.ToolCall - (*v1alpha11.ToolResult)(nil), // 15: tim.api.tool.v1alpha1.ToolResult + (*TokenUsage)(nil), // 11: tim.api.thread.v1alpha1.TokenUsage + (*Thread_ParentThreadId)(nil), // 12: tim.api.thread.v1alpha1.Thread.ParentThreadId + (*timestamppb.Timestamp)(nil), // 13: google.protobuf.Timestamp + (*v1alpha1.ToolCall)(nil), // 14: tim.api.tool.v1alpha1.ToolCall + (*v1alpha1.ToolResult)(nil), // 15: tim.api.tool.v1alpha1.ToolResult } var file_tim_api_thread_v1alpha1_thread_types_proto_depIdxs = []int32{ - 11, // 0: tim.api.thread.v1alpha1.Thread.parent_thread_id:type_name -> tim.api.thread.v1alpha1.Thread.ParentThreadId - 12, // 1: tim.api.thread.v1alpha1.Thread.create_time:type_name -> google.protobuf.Timestamp - 12, // 2: tim.api.thread.v1alpha1.Thread.update_time:type_name -> google.protobuf.Timestamp + 12, // 0: tim.api.thread.v1alpha1.Thread.parent_thread_id:type_name -> tim.api.thread.v1alpha1.Thread.ParentThreadId + 13, // 1: tim.api.thread.v1alpha1.Thread.create_time:type_name -> google.protobuf.Timestamp + 13, // 2: tim.api.thread.v1alpha1.Thread.update_time:type_name -> google.protobuf.Timestamp 1, // 3: tim.api.thread.v1alpha1.Thread.llm_state:type_name -> tim.api.thread.v1alpha1.ThreadLLMState 0, // 4: tim.api.thread.v1alpha1.LlmMessage.role:type_name -> tim.api.thread.v1alpha1.LlmMessageRole 6, // 5: tim.api.thread.v1alpha1.LlmMessage.contents:type_name -> tim.api.thread.v1alpha1.LlmMessageContent - 12, // 6: tim.api.thread.v1alpha1.LlmMessage.create_time:type_name -> google.protobuf.Timestamp - 13, // 7: tim.api.thread.v1alpha1.LlmMessage.token_usage:type_name -> tim.api.llm_response.v1alpha1.TokenUsage + 13, // 6: tim.api.thread.v1alpha1.LlmMessage.create_time:type_name -> google.protobuf.Timestamp + 11, // 7: tim.api.thread.v1alpha1.LlmMessage.token_usage:type_name -> tim.api.thread.v1alpha1.TokenUsage 5, // 8: tim.api.thread.v1alpha1.LlmMessageContent.thinking:type_name -> tim.api.thread.v1alpha1.Thinking 14, // 9: tim.api.thread.v1alpha1.LlmMessageContent.tool_call:type_name -> tim.api.tool.v1alpha1.ToolCall 15, // 10: tim.api.thread.v1alpha1.LlmMessageContent.tool_result:type_name -> tim.api.tool.v1alpha1.ToolResult - 12, // 11: tim.api.thread.v1alpha1.LlmMessageContent.create_time:type_name -> google.protobuf.Timestamp + 13, // 11: tim.api.thread.v1alpha1.LlmMessageContent.create_time:type_name -> google.protobuf.Timestamp 0, // 12: tim.api.thread.v1alpha1.ContentStartEvent.role:type_name -> tim.api.thread.v1alpha1.LlmMessageRole 2, // 13: tim.api.thread.v1alpha1.ContentStartEvent.type:type_name -> tim.api.thread.v1alpha1.ContentType 1, // 14: tim.api.thread.v1alpha1.ThreadStateChangeEvent.llm_state:type_name -> tim.api.thread.v1alpha1.ThreadLLMState - 12, // 15: tim.api.thread.v1alpha1.Thread.ParentThreadId.before_time:type_name -> google.protobuf.Timestamp + 13, // 15: tim.api.thread.v1alpha1.Thread.ParentThreadId.before_time:type_name -> google.protobuf.Timestamp 16, // [16:16] is the sub-list for method output_type 16, // [16:16] is the sub-list for method input_type 16, // [16:16] is the sub-list for extension type_name @@ -1051,7 +1131,7 @@ func file_tim_api_thread_v1alpha1_thread_types_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_tim_api_thread_v1alpha1_thread_types_proto_rawDesc), len(file_tim_api_thread_v1alpha1_thread_types_proto_rawDesc)), NumEnums: 3, - NumMessages: 9, + NumMessages: 10, NumExtensions: 0, NumServices: 0, }, diff --git a/tim-proto/gen/tim/api/llm_response/v1alpha1/llm_response_service.pb.go b/tim-proto/gen/tim/int/llm_response/v1alpha1/llm_response_service.pb.go similarity index 63% rename from tim-proto/gen/tim/api/llm_response/v1alpha1/llm_response_service.pb.go rename to tim-proto/gen/tim/int/llm_response/v1alpha1/llm_response_service.pb.go index e37610d14..4fa4f120e 100644 --- a/tim-proto/gen/tim/api/llm_response/v1alpha1/llm_response_service.pb.go +++ b/tim-proto/gen/tim/int/llm_response/v1alpha1/llm_response_service.pb.go @@ -2,7 +2,7 @@ // versions: // protoc-gen-go v1.36.9 // protoc (unknown) -// source: tim/api/llm_response/v1alpha1/llm_response_service.proto +// source: tim/int/llm_response/v1alpha1/llm_response_service.proto package llm_responsev1alpha1 @@ -37,7 +37,7 @@ type UploadLlmResponseEventsRequest struct { func (x *UploadLlmResponseEventsRequest) Reset() { *x = UploadLlmResponseEventsRequest{} - mi := &file_tim_api_llm_response_v1alpha1_llm_response_service_proto_msgTypes[0] + mi := &file_tim_int_llm_response_v1alpha1_llm_response_service_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -49,7 +49,7 @@ func (x *UploadLlmResponseEventsRequest) String() string { func (*UploadLlmResponseEventsRequest) ProtoMessage() {} func (x *UploadLlmResponseEventsRequest) ProtoReflect() protoreflect.Message { - mi := &file_tim_api_llm_response_v1alpha1_llm_response_service_proto_msgTypes[0] + mi := &file_tim_int_llm_response_v1alpha1_llm_response_service_proto_msgTypes[0] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -62,7 +62,7 @@ func (x *UploadLlmResponseEventsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UploadLlmResponseEventsRequest.ProtoReflect.Descriptor instead. func (*UploadLlmResponseEventsRequest) Descriptor() ([]byte, []int) { - return file_tim_api_llm_response_v1alpha1_llm_response_service_proto_rawDescGZIP(), []int{0} + return file_tim_int_llm_response_v1alpha1_llm_response_service_proto_rawDescGZIP(), []int{0} } func (x *UploadLlmResponseEventsRequest) GetPath() string { @@ -90,7 +90,7 @@ type UploadLlmResponseEventsResponse struct { func (x *UploadLlmResponseEventsResponse) Reset() { *x = UploadLlmResponseEventsResponse{} - mi := &file_tim_api_llm_response_v1alpha1_llm_response_service_proto_msgTypes[1] + mi := &file_tim_int_llm_response_v1alpha1_llm_response_service_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -102,7 +102,7 @@ func (x *UploadLlmResponseEventsResponse) String() string { func (*UploadLlmResponseEventsResponse) ProtoMessage() {} func (x *UploadLlmResponseEventsResponse) ProtoReflect() protoreflect.Message { - mi := &file_tim_api_llm_response_v1alpha1_llm_response_service_proto_msgTypes[1] + mi := &file_tim_int_llm_response_v1alpha1_llm_response_service_proto_msgTypes[1] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -115,7 +115,7 @@ func (x *UploadLlmResponseEventsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use UploadLlmResponseEventsResponse.ProtoReflect.Descriptor instead. func (*UploadLlmResponseEventsResponse) Descriptor() ([]byte, []int) { - return file_tim_api_llm_response_v1alpha1_llm_response_service_proto_rawDescGZIP(), []int{1} + return file_tim_int_llm_response_v1alpha1_llm_response_service_proto_rawDescGZIP(), []int{1} } func (x *UploadLlmResponseEventsResponse) GetMessageId() string { @@ -138,7 +138,7 @@ type PushLlmTokenUsageRequest struct { func (x *PushLlmTokenUsageRequest) Reset() { *x = PushLlmTokenUsageRequest{} - mi := &file_tim_api_llm_response_v1alpha1_llm_response_service_proto_msgTypes[2] + mi := &file_tim_int_llm_response_v1alpha1_llm_response_service_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -150,7 +150,7 @@ func (x *PushLlmTokenUsageRequest) String() string { func (*PushLlmTokenUsageRequest) ProtoMessage() {} func (x *PushLlmTokenUsageRequest) ProtoReflect() protoreflect.Message { - mi := &file_tim_api_llm_response_v1alpha1_llm_response_service_proto_msgTypes[2] + mi := &file_tim_int_llm_response_v1alpha1_llm_response_service_proto_msgTypes[2] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -163,7 +163,7 @@ func (x *PushLlmTokenUsageRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use PushLlmTokenUsageRequest.ProtoReflect.Descriptor instead. func (*PushLlmTokenUsageRequest) Descriptor() ([]byte, []int) { - return file_tim_api_llm_response_v1alpha1_llm_response_service_proto_rawDescGZIP(), []int{2} + return file_tim_int_llm_response_v1alpha1_llm_response_service_proto_rawDescGZIP(), []int{2} } func (x *PushLlmTokenUsageRequest) GetPath() string { @@ -189,7 +189,7 @@ type PushLlmTokenUsageResponse struct { func (x *PushLlmTokenUsageResponse) Reset() { *x = PushLlmTokenUsageResponse{} - mi := &file_tim_api_llm_response_v1alpha1_llm_response_service_proto_msgTypes[3] + mi := &file_tim_int_llm_response_v1alpha1_llm_response_service_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -201,7 +201,7 @@ func (x *PushLlmTokenUsageResponse) String() string { func (*PushLlmTokenUsageResponse) ProtoMessage() {} func (x *PushLlmTokenUsageResponse) ProtoReflect() protoreflect.Message { - mi := &file_tim_api_llm_response_v1alpha1_llm_response_service_proto_msgTypes[3] + mi := &file_tim_int_llm_response_v1alpha1_llm_response_service_proto_msgTypes[3] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -214,58 +214,58 @@ func (x *PushLlmTokenUsageResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use PushLlmTokenUsageResponse.ProtoReflect.Descriptor instead. func (*PushLlmTokenUsageResponse) Descriptor() ([]byte, []int) { - return file_tim_api_llm_response_v1alpha1_llm_response_service_proto_rawDescGZIP(), []int{3} + return file_tim_int_llm_response_v1alpha1_llm_response_service_proto_rawDescGZIP(), []int{3} } -var File_tim_api_llm_response_v1alpha1_llm_response_service_proto protoreflect.FileDescriptor +var File_tim_int_llm_response_v1alpha1_llm_response_service_proto protoreflect.FileDescriptor -const file_tim_api_llm_response_v1alpha1_llm_response_service_proto_rawDesc = "" + +const file_tim_int_llm_response_v1alpha1_llm_response_service_proto_rawDesc = "" + "\n" + - "8tim/api/llm_response/v1alpha1/llm_response_service.proto\x12\x1dtim.api.llm_response.v1alpha1\x1a\x18aep/api/field_info.proto\x1a\x1bbuf/validate/validate.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a6tim/api/llm_response/v1alpha1/llm_response_types.proto\"\x8c\x02\n" + + "8tim/int/llm_response/v1alpha1/llm_response_service.proto\x12\x1dtim.int.llm_response.v1alpha1\x1a\x18aep/api/field_info.proto\x1a\x1bbuf/validate/validate.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a6tim/int/llm_response/v1alpha1/llm_response_types.proto\"\x8c\x02\n" + "\x1eUploadLlmResponseEventsRequest\x12\x85\x01\n" + "\x04path\x18\x01 \x01(\tBq\xe0A\x02\xbaHKrI2G^orgs/[a-fA-F0-9-]{36}/users/[a-fA-F0-9-]{36}/threads/[a-fA-F0-9-]{36}$\u0091\x05\x1c\x12\x1atim.settlerlabs.com/threadR\x04path\x12b\n" + - "\x12llm_response_event\x18\x02 \x01(\v2/.tim.api.llm_response.v1alpha1.LlmResponseEventB\x03\xe0A\x02R\x10llmResponseEvent\"@\n" + + "\x12llm_response_event\x18\x02 \x01(\v2/.tim.int.llm_response.v1alpha1.LlmResponseEventB\x03\xe0A\x02R\x10llmResponseEvent\"@\n" + "\x1fUploadLlmResponseEventsResponse\x12\x1d\n" + "\n" + "message_id\x18\x01 \x01(\tR\tmessageId\"\x93\x02\n" + "\x18PushLlmTokenUsageRequest\x12\xa5\x01\n" + "\x04path\x18\x01 \x01(\tB\x90\x01\xe0A\x02\xbaHerc2a^orgs/[a-fA-F0-9-]{36}/users/[a-fA-F0-9-]{36}/threads/[a-fA-F0-9-]{36}/messages/[a-fA-F0-9-]{36}$\u0091\x05!\x12\x1ftim.settlerlabs.com/llm_messageR\x04path\x12O\n" + - "\vtoken_usage\x18\x02 \x01(\v2).tim.api.llm_response.v1alpha1.TokenUsageB\x03\xe0A\x02R\n" + + "\vtoken_usage\x18\x02 \x01(\v2).tim.int.llm_response.v1alpha1.TokenUsageB\x03\xe0A\x02R\n" + "tokenUsage\"\x1b\n" + - "\x19PushLlmTokenUsageResponse2\x97\x03\n" + + "\x19PushLlmTokenUsageResponse2\xd2\x02\n" + "\x12LlmResponseService\x12\x9c\x01\n" + - "\x17UploadLlmResponseEvents\x12=.tim.api.llm_response.v1alpha1.UploadLlmResponseEventsRequest\x1a>.tim.api.llm_response.v1alpha1.UploadLlmResponseEventsResponse\"\x00(\x01\x12\xe1\x01\n" + - "\x11PushLlmTokenUsage\x127.tim.api.llm_response.v1alpha1.PushLlmTokenUsageRequest\x1a8.tim.api.llm_response.v1alpha1.PushLlmTokenUsageResponse\"Y\xdaA\x11path, token_usage\x82\xd3\xe4\x93\x02?:\x01*\":/v1alpha1/{path=orgs/*/users/*/threads/*/messages/*}:usageB\xad\x02\n" + - "!com.tim.api.llm_response.v1alpha1B\x17LlmResponseServiceProtoP\x01Z\\github.com/Greybox-Labs/tim/tim-proto/gen/tim/api/llm_response/v1alpha1;llm_responsev1alpha1\xa2\x02\x03TAL\xaa\x02\x1cTim.Api.LlmResponse.V1alpha1\xca\x02\x1cTim\\Api\\LlmResponse\\V1alpha1\xe2\x02(Tim\\Api\\LlmResponse\\V1alpha1\\GPBMetadata\xea\x02\x1fTim::Api::LlmResponse::V1alpha1b\x06proto3" + "\x17UploadLlmResponseEvents\x12=.tim.int.llm_response.v1alpha1.UploadLlmResponseEventsRequest\x1a>.tim.int.llm_response.v1alpha1.UploadLlmResponseEventsResponse\"\x00(\x01\x12\x9c\x01\n" + + "\x11PushLlmTokenUsage\x127.tim.int.llm_response.v1alpha1.PushLlmTokenUsageRequest\x1a8.tim.int.llm_response.v1alpha1.PushLlmTokenUsageResponse\"\x14\xdaA\x11path, token_usageB\xaf\x02\n" + + "!com.tim.int.llm_response.v1alpha1B\x17LlmResponseServiceProtoP\x01Z\\github.com/Greybox-Labs/tim/tim-proto/gen/tim/int/llm_response/v1alpha1;llm_responsev1alpha1\xa2\x02\x03TIL\xaa\x02\x1cTim.Int.LlmResponse.V1alpha1\xca\x02\x1dTim\\Int_\\LlmResponse\\V1alpha1\xe2\x02)Tim\\Int_\\LlmResponse\\V1alpha1\\GPBMetadata\xea\x02\x1fTim::Int::LlmResponse::V1alpha1b\x06proto3" var ( - file_tim_api_llm_response_v1alpha1_llm_response_service_proto_rawDescOnce sync.Once - file_tim_api_llm_response_v1alpha1_llm_response_service_proto_rawDescData []byte + file_tim_int_llm_response_v1alpha1_llm_response_service_proto_rawDescOnce sync.Once + file_tim_int_llm_response_v1alpha1_llm_response_service_proto_rawDescData []byte ) -func file_tim_api_llm_response_v1alpha1_llm_response_service_proto_rawDescGZIP() []byte { - file_tim_api_llm_response_v1alpha1_llm_response_service_proto_rawDescOnce.Do(func() { - file_tim_api_llm_response_v1alpha1_llm_response_service_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_tim_api_llm_response_v1alpha1_llm_response_service_proto_rawDesc), len(file_tim_api_llm_response_v1alpha1_llm_response_service_proto_rawDesc))) +func file_tim_int_llm_response_v1alpha1_llm_response_service_proto_rawDescGZIP() []byte { + file_tim_int_llm_response_v1alpha1_llm_response_service_proto_rawDescOnce.Do(func() { + file_tim_int_llm_response_v1alpha1_llm_response_service_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_tim_int_llm_response_v1alpha1_llm_response_service_proto_rawDesc), len(file_tim_int_llm_response_v1alpha1_llm_response_service_proto_rawDesc))) }) - return file_tim_api_llm_response_v1alpha1_llm_response_service_proto_rawDescData + return file_tim_int_llm_response_v1alpha1_llm_response_service_proto_rawDescData } -var file_tim_api_llm_response_v1alpha1_llm_response_service_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_tim_api_llm_response_v1alpha1_llm_response_service_proto_goTypes = []any{ - (*UploadLlmResponseEventsRequest)(nil), // 0: tim.api.llm_response.v1alpha1.UploadLlmResponseEventsRequest - (*UploadLlmResponseEventsResponse)(nil), // 1: tim.api.llm_response.v1alpha1.UploadLlmResponseEventsResponse - (*PushLlmTokenUsageRequest)(nil), // 2: tim.api.llm_response.v1alpha1.PushLlmTokenUsageRequest - (*PushLlmTokenUsageResponse)(nil), // 3: tim.api.llm_response.v1alpha1.PushLlmTokenUsageResponse - (*LlmResponseEvent)(nil), // 4: tim.api.llm_response.v1alpha1.LlmResponseEvent - (*TokenUsage)(nil), // 5: tim.api.llm_response.v1alpha1.TokenUsage +var file_tim_int_llm_response_v1alpha1_llm_response_service_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_tim_int_llm_response_v1alpha1_llm_response_service_proto_goTypes = []any{ + (*UploadLlmResponseEventsRequest)(nil), // 0: tim.int.llm_response.v1alpha1.UploadLlmResponseEventsRequest + (*UploadLlmResponseEventsResponse)(nil), // 1: tim.int.llm_response.v1alpha1.UploadLlmResponseEventsResponse + (*PushLlmTokenUsageRequest)(nil), // 2: tim.int.llm_response.v1alpha1.PushLlmTokenUsageRequest + (*PushLlmTokenUsageResponse)(nil), // 3: tim.int.llm_response.v1alpha1.PushLlmTokenUsageResponse + (*LlmResponseEvent)(nil), // 4: tim.int.llm_response.v1alpha1.LlmResponseEvent + (*TokenUsage)(nil), // 5: tim.int.llm_response.v1alpha1.TokenUsage } -var file_tim_api_llm_response_v1alpha1_llm_response_service_proto_depIdxs = []int32{ - 4, // 0: tim.api.llm_response.v1alpha1.UploadLlmResponseEventsRequest.llm_response_event:type_name -> tim.api.llm_response.v1alpha1.LlmResponseEvent - 5, // 1: tim.api.llm_response.v1alpha1.PushLlmTokenUsageRequest.token_usage:type_name -> tim.api.llm_response.v1alpha1.TokenUsage - 0, // 2: tim.api.llm_response.v1alpha1.LlmResponseService.UploadLlmResponseEvents:input_type -> tim.api.llm_response.v1alpha1.UploadLlmResponseEventsRequest - 2, // 3: tim.api.llm_response.v1alpha1.LlmResponseService.PushLlmTokenUsage:input_type -> tim.api.llm_response.v1alpha1.PushLlmTokenUsageRequest - 1, // 4: tim.api.llm_response.v1alpha1.LlmResponseService.UploadLlmResponseEvents:output_type -> tim.api.llm_response.v1alpha1.UploadLlmResponseEventsResponse - 3, // 5: tim.api.llm_response.v1alpha1.LlmResponseService.PushLlmTokenUsage:output_type -> tim.api.llm_response.v1alpha1.PushLlmTokenUsageResponse +var file_tim_int_llm_response_v1alpha1_llm_response_service_proto_depIdxs = []int32{ + 4, // 0: tim.int.llm_response.v1alpha1.UploadLlmResponseEventsRequest.llm_response_event:type_name -> tim.int.llm_response.v1alpha1.LlmResponseEvent + 5, // 1: tim.int.llm_response.v1alpha1.PushLlmTokenUsageRequest.token_usage:type_name -> tim.int.llm_response.v1alpha1.TokenUsage + 0, // 2: tim.int.llm_response.v1alpha1.LlmResponseService.UploadLlmResponseEvents:input_type -> tim.int.llm_response.v1alpha1.UploadLlmResponseEventsRequest + 2, // 3: tim.int.llm_response.v1alpha1.LlmResponseService.PushLlmTokenUsage:input_type -> tim.int.llm_response.v1alpha1.PushLlmTokenUsageRequest + 1, // 4: tim.int.llm_response.v1alpha1.LlmResponseService.UploadLlmResponseEvents:output_type -> tim.int.llm_response.v1alpha1.UploadLlmResponseEventsResponse + 3, // 5: tim.int.llm_response.v1alpha1.LlmResponseService.PushLlmTokenUsage:output_type -> tim.int.llm_response.v1alpha1.PushLlmTokenUsageResponse 4, // [4:6] is the sub-list for method output_type 2, // [2:4] is the sub-list for method input_type 2, // [2:2] is the sub-list for extension type_name @@ -273,27 +273,27 @@ var file_tim_api_llm_response_v1alpha1_llm_response_service_proto_depIdxs = []in 0, // [0:2] is the sub-list for field type_name } -func init() { file_tim_api_llm_response_v1alpha1_llm_response_service_proto_init() } -func file_tim_api_llm_response_v1alpha1_llm_response_service_proto_init() { - if File_tim_api_llm_response_v1alpha1_llm_response_service_proto != nil { +func init() { file_tim_int_llm_response_v1alpha1_llm_response_service_proto_init() } +func file_tim_int_llm_response_v1alpha1_llm_response_service_proto_init() { + if File_tim_int_llm_response_v1alpha1_llm_response_service_proto != nil { return } - file_tim_api_llm_response_v1alpha1_llm_response_types_proto_init() + file_tim_int_llm_response_v1alpha1_llm_response_types_proto_init() type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_tim_api_llm_response_v1alpha1_llm_response_service_proto_rawDesc), len(file_tim_api_llm_response_v1alpha1_llm_response_service_proto_rawDesc)), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_tim_int_llm_response_v1alpha1_llm_response_service_proto_rawDesc), len(file_tim_int_llm_response_v1alpha1_llm_response_service_proto_rawDesc)), NumEnums: 0, NumMessages: 4, NumExtensions: 0, NumServices: 1, }, - GoTypes: file_tim_api_llm_response_v1alpha1_llm_response_service_proto_goTypes, - DependencyIndexes: file_tim_api_llm_response_v1alpha1_llm_response_service_proto_depIdxs, - MessageInfos: file_tim_api_llm_response_v1alpha1_llm_response_service_proto_msgTypes, + GoTypes: file_tim_int_llm_response_v1alpha1_llm_response_service_proto_goTypes, + DependencyIndexes: file_tim_int_llm_response_v1alpha1_llm_response_service_proto_depIdxs, + MessageInfos: file_tim_int_llm_response_v1alpha1_llm_response_service_proto_msgTypes, }.Build() - File_tim_api_llm_response_v1alpha1_llm_response_service_proto = out.File - file_tim_api_llm_response_v1alpha1_llm_response_service_proto_goTypes = nil - file_tim_api_llm_response_v1alpha1_llm_response_service_proto_depIdxs = nil + File_tim_int_llm_response_v1alpha1_llm_response_service_proto = out.File + file_tim_int_llm_response_v1alpha1_llm_response_service_proto_goTypes = nil + file_tim_int_llm_response_v1alpha1_llm_response_service_proto_depIdxs = nil } diff --git a/tim-proto/gen/tim/api/llm_response/v1alpha1/llm_response_service.swagger.json b/tim-proto/gen/tim/int/llm_response/v1alpha1/llm_response_service.swagger.json similarity index 87% rename from tim-proto/gen/tim/api/llm_response/v1alpha1/llm_response_service.swagger.json rename to tim-proto/gen/tim/int/llm_response/v1alpha1/llm_response_service.swagger.json index 78bcca7af..685dc471d 100644 --- a/tim-proto/gen/tim/api/llm_response/v1alpha1/llm_response_service.swagger.json +++ b/tim-proto/gen/tim/int/llm_response/v1alpha1/llm_response_service.swagger.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "title": "tim/api/llm_response/v1alpha1/llm_response_service.proto", + "title": "tim/int/llm_response/v1alpha1/llm_response_service.proto", "version": "version not set" }, "tags": [ @@ -15,63 +15,8 @@ "produces": [ "application/json" ], - "paths": { - "/v1alpha1/{path}:usage": { - "post": { - "summary": "Provide the token usage for an LLM message", - "operationId": "LlmResponseService_PushLlmTokenUsage", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1alpha1PushLlmTokenUsageResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "path", - "description": "The resource path of the message", - "in": "path", - "required": true, - "type": "string", - "pattern": "orgs/[^/]+/users/[^/]+/threads/[^/]+/messages/[^/]+" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/LlmResponseServicePushLlmTokenUsageBody" - } - } - ], - "tags": [ - "LlmResponseService" - ] - } - } - }, + "paths": {}, "definitions": { - "LlmResponseServicePushLlmTokenUsageBody": { - "type": "object", - "properties": { - "tokenUsage": { - "$ref": "#/definitions/v1alpha1TokenUsage", - "title": "The token usage" - } - }, - "title": "PushLlmTokenUsageRequest is used to post the token usage for an LLM message", - "required": [ - "tokenUsage" - ] - }, "MessageStopStopReason": { "type": "string", "enum": [ @@ -88,6 +33,32 @@ "default": "STOP_REASON_UNSPECIFIED", "description": "StopReason denotes the available stop reasons.\n\n - STOP_REASON_UNSPECIFIED: Default unspecified, generally indicates an issue\n - STOP_REASON_END_TURN: Stopped due to the end of the LLM turn.\n - STOP_REASON_ERROR: Stopped due to an error.\n - STOP_REASON_MAX_TOKENS: Stopped due to exceeding the max allowed tokens.\n - STOP_REASON_MODEL_CONTEXT_WINDOW_EXCEEDED: Stopped due to exceeding the model context window.\n - STOP_REASON_PAUSE_TURN: Stopped due to the LLM pausing the turn.\n - STOP_REASON_REFUSAL: Stopped due to the LLM refusing to continue.\n - STOP_REASON_STOP_SEQUENCE: Stopped due to the stop sequence.\n - STOP_REASON_TOOL_USE: Stopped due to the LLM using a tool." }, + "intllm_responsev1alpha1TokenUsage": { + "type": "object", + "properties": { + "inputTokens": { + "type": "string", + "format": "int64", + "description": "The number of input tokens." + }, + "outputTokens": { + "type": "string", + "format": "int64", + "description": "The number of output tokens." + }, + "cacheCreateTokens": { + "type": "string", + "format": "int64", + "description": "The number of cache create tokens." + }, + "cacheReadTokens": { + "type": "string", + "format": "int64", + "description": "The number of cache read tokens." + } + }, + "description": "TokenUsage is the usage of tokens for an llm call." + }, "protobufAny": { "type": "object", "properties": { @@ -242,32 +213,6 @@ "type": "object", "title": "PushLlmTokenUsageResponse is the response for posting the token usage for an LLM message" }, - "v1alpha1TokenUsage": { - "type": "object", - "properties": { - "inputTokens": { - "type": "string", - "format": "int64", - "description": "The number of input tokens." - }, - "outputTokens": { - "type": "string", - "format": "int64", - "description": "The number of output tokens." - }, - "cacheCreateTokens": { - "type": "string", - "format": "int64", - "description": "The number of cache create tokens." - }, - "cacheReadTokens": { - "type": "string", - "format": "int64", - "description": "The number of cache read tokens." - } - }, - "description": "TokenUsage is the usage of tokens for an llm call." - }, "v1alpha1UploadLlmResponseEventsResponse": { "type": "object", "properties": { diff --git a/tim-proto/gen/tim/api/llm_response/v1alpha1/llm_response_types.pb.go b/tim-proto/gen/tim/int/llm_response/v1alpha1/llm_response_types.pb.go similarity index 77% rename from tim-proto/gen/tim/api/llm_response/v1alpha1/llm_response_types.pb.go rename to tim-proto/gen/tim/int/llm_response/v1alpha1/llm_response_types.pb.go index a272c3e0c..027f39aed 100644 --- a/tim-proto/gen/tim/api/llm_response/v1alpha1/llm_response_types.pb.go +++ b/tim-proto/gen/tim/int/llm_response/v1alpha1/llm_response_types.pb.go @@ -2,7 +2,7 @@ // versions: // protoc-gen-go v1.36.9 // protoc (unknown) -// source: tim/api/llm_response/v1alpha1/llm_response_types.proto +// source: tim/int/llm_response/v1alpha1/llm_response_types.proto package llm_responsev1alpha1 @@ -63,11 +63,11 @@ func (x ContentBlockType) String() string { } func (ContentBlockType) Descriptor() protoreflect.EnumDescriptor { - return file_tim_api_llm_response_v1alpha1_llm_response_types_proto_enumTypes[0].Descriptor() + return file_tim_int_llm_response_v1alpha1_llm_response_types_proto_enumTypes[0].Descriptor() } func (ContentBlockType) Type() protoreflect.EnumType { - return &file_tim_api_llm_response_v1alpha1_llm_response_types_proto_enumTypes[0] + return &file_tim_int_llm_response_v1alpha1_llm_response_types_proto_enumTypes[0] } func (x ContentBlockType) Number() protoreflect.EnumNumber { @@ -76,7 +76,7 @@ func (x ContentBlockType) Number() protoreflect.EnumNumber { // Deprecated: Use ContentBlockType.Descriptor instead. func (ContentBlockType) EnumDescriptor() ([]byte, []int) { - return file_tim_api_llm_response_v1alpha1_llm_response_types_proto_rawDescGZIP(), []int{0} + return file_tim_int_llm_response_v1alpha1_llm_response_types_proto_rawDescGZIP(), []int{0} } // StopReason denotes the available stop reasons. @@ -140,11 +140,11 @@ func (x MessageStop_StopReason) String() string { } func (MessageStop_StopReason) Descriptor() protoreflect.EnumDescriptor { - return file_tim_api_llm_response_v1alpha1_llm_response_types_proto_enumTypes[1].Descriptor() + return file_tim_int_llm_response_v1alpha1_llm_response_types_proto_enumTypes[1].Descriptor() } func (MessageStop_StopReason) Type() protoreflect.EnumType { - return &file_tim_api_llm_response_v1alpha1_llm_response_types_proto_enumTypes[1] + return &file_tim_int_llm_response_v1alpha1_llm_response_types_proto_enumTypes[1] } func (x MessageStop_StopReason) Number() protoreflect.EnumNumber { @@ -153,7 +153,7 @@ func (x MessageStop_StopReason) Number() protoreflect.EnumNumber { // Deprecated: Use MessageStop_StopReason.Descriptor instead. func (MessageStop_StopReason) EnumDescriptor() ([]byte, []int) { - return file_tim_api_llm_response_v1alpha1_llm_response_types_proto_rawDescGZIP(), []int{2, 0} + return file_tim_int_llm_response_v1alpha1_llm_response_types_proto_rawDescGZIP(), []int{2, 0} } // LlmResponseEvent is an event that represents an llm response @@ -175,7 +175,7 @@ type LlmResponseEvent struct { func (x *LlmResponseEvent) Reset() { *x = LlmResponseEvent{} - mi := &file_tim_api_llm_response_v1alpha1_llm_response_types_proto_msgTypes[0] + mi := &file_tim_int_llm_response_v1alpha1_llm_response_types_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -187,7 +187,7 @@ func (x *LlmResponseEvent) String() string { func (*LlmResponseEvent) ProtoMessage() {} func (x *LlmResponseEvent) ProtoReflect() protoreflect.Message { - mi := &file_tim_api_llm_response_v1alpha1_llm_response_types_proto_msgTypes[0] + mi := &file_tim_int_llm_response_v1alpha1_llm_response_types_proto_msgTypes[0] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -200,7 +200,7 @@ func (x *LlmResponseEvent) ProtoReflect() protoreflect.Message { // Deprecated: Use LlmResponseEvent.ProtoReflect.Descriptor instead. func (*LlmResponseEvent) Descriptor() ([]byte, []int) { - return file_tim_api_llm_response_v1alpha1_llm_response_types_proto_rawDescGZIP(), []int{0} + return file_tim_int_llm_response_v1alpha1_llm_response_types_proto_rawDescGZIP(), []int{0} } func (x *LlmResponseEvent) GetData() isLlmResponseEvent_Data { @@ -304,7 +304,7 @@ type MessageStart struct { func (x *MessageStart) Reset() { *x = MessageStart{} - mi := &file_tim_api_llm_response_v1alpha1_llm_response_types_proto_msgTypes[1] + mi := &file_tim_int_llm_response_v1alpha1_llm_response_types_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -316,7 +316,7 @@ func (x *MessageStart) String() string { func (*MessageStart) ProtoMessage() {} func (x *MessageStart) ProtoReflect() protoreflect.Message { - mi := &file_tim_api_llm_response_v1alpha1_llm_response_types_proto_msgTypes[1] + mi := &file_tim_int_llm_response_v1alpha1_llm_response_types_proto_msgTypes[1] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -329,7 +329,7 @@ func (x *MessageStart) ProtoReflect() protoreflect.Message { // Deprecated: Use MessageStart.ProtoReflect.Descriptor instead. func (*MessageStart) Descriptor() ([]byte, []int) { - return file_tim_api_llm_response_v1alpha1_llm_response_types_proto_rawDescGZIP(), []int{1} + return file_tim_int_llm_response_v1alpha1_llm_response_types_proto_rawDescGZIP(), []int{1} } // MessageStop is an event that represents the stop of a message containing @@ -337,7 +337,7 @@ func (*MessageStart) Descriptor() ([]byte, []int) { type MessageStop struct { state protoimpl.MessageState `protogen:"open.v1"` // The reason for the stop - Reason MessageStop_StopReason `protobuf:"varint,1,opt,name=reason,proto3,enum=tim.api.llm_response.v1alpha1.MessageStop_StopReason" json:"reason,omitempty"` + Reason MessageStop_StopReason `protobuf:"varint,1,opt,name=reason,proto3,enum=tim.int.llm_response.v1alpha1.MessageStop_StopReason" json:"reason,omitempty"` // Optional: The sequence that caused the stop StopSequence string `protobuf:"bytes,2,opt,name=stop_sequence,json=stopSequence,proto3" json:"stop_sequence,omitempty"` // Optional: The error that caused the stop @@ -348,7 +348,7 @@ type MessageStop struct { func (x *MessageStop) Reset() { *x = MessageStop{} - mi := &file_tim_api_llm_response_v1alpha1_llm_response_types_proto_msgTypes[2] + mi := &file_tim_int_llm_response_v1alpha1_llm_response_types_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -360,7 +360,7 @@ func (x *MessageStop) String() string { func (*MessageStop) ProtoMessage() {} func (x *MessageStop) ProtoReflect() protoreflect.Message { - mi := &file_tim_api_llm_response_v1alpha1_llm_response_types_proto_msgTypes[2] + mi := &file_tim_int_llm_response_v1alpha1_llm_response_types_proto_msgTypes[2] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -373,7 +373,7 @@ func (x *MessageStop) ProtoReflect() protoreflect.Message { // Deprecated: Use MessageStop.ProtoReflect.Descriptor instead. func (*MessageStop) Descriptor() ([]byte, []int) { - return file_tim_api_llm_response_v1alpha1_llm_response_types_proto_rawDescGZIP(), []int{2} + return file_tim_int_llm_response_v1alpha1_llm_response_types_proto_rawDescGZIP(), []int{2} } func (x *MessageStop) GetReason() MessageStop_StopReason { @@ -401,7 +401,7 @@ func (x *MessageStop) GetError() string { type ContentBlockStart struct { state protoimpl.MessageState `protogen:"open.v1"` // The type of the content block. - Type ContentBlockType `protobuf:"varint,1,opt,name=type,proto3,enum=tim.api.llm_response.v1alpha1.ContentBlockType" json:"type,omitempty"` + Type ContentBlockType `protobuf:"varint,1,opt,name=type,proto3,enum=tim.int.llm_response.v1alpha1.ContentBlockType" json:"type,omitempty"` // The index of the content block. Index int64 `protobuf:"varint,2,opt,name=index,proto3" json:"index,omitempty"` // The tool name if the content block is a tool use. @@ -414,7 +414,7 @@ type ContentBlockStart struct { func (x *ContentBlockStart) Reset() { *x = ContentBlockStart{} - mi := &file_tim_api_llm_response_v1alpha1_llm_response_types_proto_msgTypes[3] + mi := &file_tim_int_llm_response_v1alpha1_llm_response_types_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -426,7 +426,7 @@ func (x *ContentBlockStart) String() string { func (*ContentBlockStart) ProtoMessage() {} func (x *ContentBlockStart) ProtoReflect() protoreflect.Message { - mi := &file_tim_api_llm_response_v1alpha1_llm_response_types_proto_msgTypes[3] + mi := &file_tim_int_llm_response_v1alpha1_llm_response_types_proto_msgTypes[3] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -439,7 +439,7 @@ func (x *ContentBlockStart) ProtoReflect() protoreflect.Message { // Deprecated: Use ContentBlockStart.ProtoReflect.Descriptor instead. func (*ContentBlockStart) Descriptor() ([]byte, []int) { - return file_tim_api_llm_response_v1alpha1_llm_response_types_proto_rawDescGZIP(), []int{3} + return file_tim_int_llm_response_v1alpha1_llm_response_types_proto_rawDescGZIP(), []int{3} } func (x *ContentBlockStart) GetType() ContentBlockType { @@ -474,7 +474,7 @@ func (x *ContentBlockStart) GetToolCallId() string { type ContentBlockDelta struct { state protoimpl.MessageState `protogen:"open.v1"` // The type of the content block. - Type ContentBlockType `protobuf:"varint,1,opt,name=type,proto3,enum=tim.api.llm_response.v1alpha1.ContentBlockType" json:"type,omitempty"` + Type ContentBlockType `protobuf:"varint,1,opt,name=type,proto3,enum=tim.int.llm_response.v1alpha1.ContentBlockType" json:"type,omitempty"` // The index of the content block. Index int64 `protobuf:"varint,2,opt,name=index,proto3" json:"index,omitempty"` // The text delta of the content block delta. @@ -488,7 +488,7 @@ type ContentBlockDelta struct { func (x *ContentBlockDelta) Reset() { *x = ContentBlockDelta{} - mi := &file_tim_api_llm_response_v1alpha1_llm_response_types_proto_msgTypes[4] + mi := &file_tim_int_llm_response_v1alpha1_llm_response_types_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -500,7 +500,7 @@ func (x *ContentBlockDelta) String() string { func (*ContentBlockDelta) ProtoMessage() {} func (x *ContentBlockDelta) ProtoReflect() protoreflect.Message { - mi := &file_tim_api_llm_response_v1alpha1_llm_response_types_proto_msgTypes[4] + mi := &file_tim_int_llm_response_v1alpha1_llm_response_types_proto_msgTypes[4] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -513,7 +513,7 @@ func (x *ContentBlockDelta) ProtoReflect() protoreflect.Message { // Deprecated: Use ContentBlockDelta.ProtoReflect.Descriptor instead. func (*ContentBlockDelta) Descriptor() ([]byte, []int) { - return file_tim_api_llm_response_v1alpha1_llm_response_types_proto_rawDescGZIP(), []int{4} + return file_tim_int_llm_response_v1alpha1_llm_response_types_proto_rawDescGZIP(), []int{4} } func (x *ContentBlockDelta) GetType() ContentBlockType { @@ -548,7 +548,7 @@ func (x *ContentBlockDelta) GetSignatureDelta() string { type ContentBlockStop struct { state protoimpl.MessageState `protogen:"open.v1"` // The type of the content block. - Type ContentBlockType `protobuf:"varint,1,opt,name=type,proto3,enum=tim.api.llm_response.v1alpha1.ContentBlockType" json:"type,omitempty"` + Type ContentBlockType `protobuf:"varint,1,opt,name=type,proto3,enum=tim.int.llm_response.v1alpha1.ContentBlockType" json:"type,omitempty"` // The index of the content block. Index int64 `protobuf:"varint,2,opt,name=index,proto3" json:"index,omitempty"` unknownFields protoimpl.UnknownFields @@ -557,7 +557,7 @@ type ContentBlockStop struct { func (x *ContentBlockStop) Reset() { *x = ContentBlockStop{} - mi := &file_tim_api_llm_response_v1alpha1_llm_response_types_proto_msgTypes[5] + mi := &file_tim_int_llm_response_v1alpha1_llm_response_types_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -569,7 +569,7 @@ func (x *ContentBlockStop) String() string { func (*ContentBlockStop) ProtoMessage() {} func (x *ContentBlockStop) ProtoReflect() protoreflect.Message { - mi := &file_tim_api_llm_response_v1alpha1_llm_response_types_proto_msgTypes[5] + mi := &file_tim_int_llm_response_v1alpha1_llm_response_types_proto_msgTypes[5] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -582,7 +582,7 @@ func (x *ContentBlockStop) ProtoReflect() protoreflect.Message { // Deprecated: Use ContentBlockStop.ProtoReflect.Descriptor instead. func (*ContentBlockStop) Descriptor() ([]byte, []int) { - return file_tim_api_llm_response_v1alpha1_llm_response_types_proto_rawDescGZIP(), []int{5} + return file_tim_int_llm_response_v1alpha1_llm_response_types_proto_rawDescGZIP(), []int{5} } func (x *ContentBlockStop) GetType() ContentBlockType { @@ -616,7 +616,7 @@ type TokenUsage struct { func (x *TokenUsage) Reset() { *x = TokenUsage{} - mi := &file_tim_api_llm_response_v1alpha1_llm_response_types_proto_msgTypes[6] + mi := &file_tim_int_llm_response_v1alpha1_llm_response_types_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -628,7 +628,7 @@ func (x *TokenUsage) String() string { func (*TokenUsage) ProtoMessage() {} func (x *TokenUsage) ProtoReflect() protoreflect.Message { - mi := &file_tim_api_llm_response_v1alpha1_llm_response_types_proto_msgTypes[6] + mi := &file_tim_int_llm_response_v1alpha1_llm_response_types_proto_msgTypes[6] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -641,7 +641,7 @@ func (x *TokenUsage) ProtoReflect() protoreflect.Message { // Deprecated: Use TokenUsage.ProtoReflect.Descriptor instead. func (*TokenUsage) Descriptor() ([]byte, []int) { - return file_tim_api_llm_response_v1alpha1_llm_response_types_proto_rawDescGZIP(), []int{6} + return file_tim_int_llm_response_v1alpha1_llm_response_types_proto_rawDescGZIP(), []int{6} } func (x *TokenUsage) GetInputTokens() int64 { @@ -672,21 +672,21 @@ func (x *TokenUsage) GetCacheReadTokens() int64 { return 0 } -var File_tim_api_llm_response_v1alpha1_llm_response_types_proto protoreflect.FileDescriptor +var File_tim_int_llm_response_v1alpha1_llm_response_types_proto protoreflect.FileDescriptor -const file_tim_api_llm_response_v1alpha1_llm_response_types_proto_rawDesc = "" + +const file_tim_int_llm_response_v1alpha1_llm_response_types_proto_rawDesc = "" + "\n" + - "6tim/api/llm_response/v1alpha1/llm_response_types.proto\x12\x1dtim.api.llm_response.v1alpha1\x1a\x1bbuf/validate/validate.proto\"\xe8\x03\n" + + "6tim/int/llm_response/v1alpha1/llm_response_types.proto\x12\x1dtim.int.llm_response.v1alpha1\x1a\x1bbuf/validate/validate.proto\"\xe8\x03\n" + "\x10LlmResponseEvent\x12R\n" + - "\rmessage_start\x18\x01 \x01(\v2+.tim.api.llm_response.v1alpha1.MessageStartH\x00R\fmessageStart\x12O\n" + - "\fmessage_stop\x18\x02 \x01(\v2*.tim.api.llm_response.v1alpha1.MessageStopH\x00R\vmessageStop\x12b\n" + - "\x13content_block_start\x18\x03 \x01(\v20.tim.api.llm_response.v1alpha1.ContentBlockStartH\x00R\x11contentBlockStart\x12b\n" + - "\x13content_block_delta\x18\x04 \x01(\v20.tim.api.llm_response.v1alpha1.ContentBlockDeltaH\x00R\x11contentBlockDelta\x12_\n" + - "\x12content_block_stop\x18\x05 \x01(\v2/.tim.api.llm_response.v1alpha1.ContentBlockStopH\x00R\x10contentBlockStopB\x06\n" + + "\rmessage_start\x18\x01 \x01(\v2+.tim.int.llm_response.v1alpha1.MessageStartH\x00R\fmessageStart\x12O\n" + + "\fmessage_stop\x18\x02 \x01(\v2*.tim.int.llm_response.v1alpha1.MessageStopH\x00R\vmessageStop\x12b\n" + + "\x13content_block_start\x18\x03 \x01(\v20.tim.int.llm_response.v1alpha1.ContentBlockStartH\x00R\x11contentBlockStart\x12b\n" + + "\x13content_block_delta\x18\x04 \x01(\v20.tim.int.llm_response.v1alpha1.ContentBlockDeltaH\x00R\x11contentBlockDelta\x12_\n" + + "\x12content_block_stop\x18\x05 \x01(\v2/.tim.int.llm_response.v1alpha1.ContentBlockStopH\x00R\x10contentBlockStopB\x06\n" + "\x04data\"\x0e\n" + "\fMessageStart\"\xb5\x03\n" + "\vMessageStop\x12U\n" + - "\x06reason\x18\x01 \x01(\x0e25.tim.api.llm_response.v1alpha1.MessageStop.StopReasonB\x06\xbaH\x03\xc8\x01\x01R\x06reason\x12#\n" + + "\x06reason\x18\x01 \x01(\x0e25.tim.int.llm_response.v1alpha1.MessageStop.StopReasonB\x06\xbaH\x03\xc8\x01\x01R\x06reason\x12#\n" + "\rstop_sequence\x18\x02 \x01(\tR\fstopSequence\x12\x14\n" + "\x05error\x18\x03 \x01(\tR\x05error\"\x93\x02\n" + "\n" + @@ -701,19 +701,19 @@ const file_tim_api_llm_response_v1alpha1_llm_response_types_proto_rawDesc = "" + "\x19STOP_REASON_STOP_SEQUENCE\x10\a\x12\x18\n" + "\x14STOP_REASON_TOOL_USE\x10\b\"\xbe\x01\n" + "\x11ContentBlockStart\x12K\n" + - "\x04type\x18\x01 \x01(\x0e2/.tim.api.llm_response.v1alpha1.ContentBlockTypeB\x06\xbaH\x03\xc8\x01\x01R\x04type\x12\x1d\n" + + "\x04type\x18\x01 \x01(\x0e2/.tim.int.llm_response.v1alpha1.ContentBlockTypeB\x06\xbaH\x03\xc8\x01\x01R\x04type\x12\x1d\n" + "\x05index\x18\x02 \x01(\x03B\a\xbaH\x04\"\x02(\x00R\x05index\x12\x1b\n" + "\ttool_name\x18\x03 \x01(\tR\btoolName\x12 \n" + "\ftool_call_id\x18\x04 \x01(\tR\n" + "toolCallId\"\xc7\x01\n" + "\x11ContentBlockDelta\x12K\n" + - "\x04type\x18\x01 \x01(\x0e2/.tim.api.llm_response.v1alpha1.ContentBlockTypeB\x06\xbaH\x03\xc8\x01\x01R\x04type\x12\x1d\n" + + "\x04type\x18\x01 \x01(\x0e2/.tim.int.llm_response.v1alpha1.ContentBlockTypeB\x06\xbaH\x03\xc8\x01\x01R\x04type\x12\x1d\n" + "\x05index\x18\x02 \x01(\x03B\a\xbaH\x04\"\x02(\x00R\x05index\x12\x1d\n" + "\n" + "text_delta\x18\x03 \x01(\tR\ttextDelta\x12'\n" + "\x0fsignature_delta\x18\x04 \x01(\tR\x0esignatureDelta\"~\n" + "\x10ContentBlockStop\x12K\n" + - "\x04type\x18\x01 \x01(\x0e2/.tim.api.llm_response.v1alpha1.ContentBlockTypeB\x06\xbaH\x03\xc8\x01\x01R\x04type\x12\x1d\n" + + "\x04type\x18\x01 \x01(\x0e2/.tim.int.llm_response.v1alpha1.ContentBlockTypeB\x06\xbaH\x03\xc8\x01\x01R\x04type\x12\x1d\n" + "\x05index\x18\x02 \x01(\x03B\a\xbaH\x04\"\x02(\x00R\x05index\"\xb0\x01\n" + "\n" + "TokenUsage\x12!\n" + @@ -725,44 +725,44 @@ const file_tim_api_llm_response_v1alpha1_llm_response_types_proto_rawDesc = "" + "\x1eCONTENT_BLOCK_TYPE_UNSPECIFIED\x10\x00\x12\x1b\n" + "\x17CONTENT_BLOCK_TYPE_TEXT\x10\x01\x12\x1f\n" + "\x1bCONTENT_BLOCK_TYPE_THINKING\x10\x02\x12\x1f\n" + - "\x1bCONTENT_BLOCK_TYPE_TOOL_USE\x10\x03B\xab\x02\n" + - "!com.tim.api.llm_response.v1alpha1B\x15LlmResponseTypesProtoP\x01Z\\github.com/Greybox-Labs/tim/tim-proto/gen/tim/api/llm_response/v1alpha1;llm_responsev1alpha1\xa2\x02\x03TAL\xaa\x02\x1cTim.Api.LlmResponse.V1alpha1\xca\x02\x1cTim\\Api\\LlmResponse\\V1alpha1\xe2\x02(Tim\\Api\\LlmResponse\\V1alpha1\\GPBMetadata\xea\x02\x1fTim::Api::LlmResponse::V1alpha1b\x06proto3" + "\x1bCONTENT_BLOCK_TYPE_TOOL_USE\x10\x03B\xad\x02\n" + + "!com.tim.int.llm_response.v1alpha1B\x15LlmResponseTypesProtoP\x01Z\\github.com/Greybox-Labs/tim/tim-proto/gen/tim/int/llm_response/v1alpha1;llm_responsev1alpha1\xa2\x02\x03TIL\xaa\x02\x1cTim.Int.LlmResponse.V1alpha1\xca\x02\x1dTim\\Int_\\LlmResponse\\V1alpha1\xe2\x02)Tim\\Int_\\LlmResponse\\V1alpha1\\GPBMetadata\xea\x02\x1fTim::Int::LlmResponse::V1alpha1b\x06proto3" var ( - file_tim_api_llm_response_v1alpha1_llm_response_types_proto_rawDescOnce sync.Once - file_tim_api_llm_response_v1alpha1_llm_response_types_proto_rawDescData []byte + file_tim_int_llm_response_v1alpha1_llm_response_types_proto_rawDescOnce sync.Once + file_tim_int_llm_response_v1alpha1_llm_response_types_proto_rawDescData []byte ) -func file_tim_api_llm_response_v1alpha1_llm_response_types_proto_rawDescGZIP() []byte { - file_tim_api_llm_response_v1alpha1_llm_response_types_proto_rawDescOnce.Do(func() { - file_tim_api_llm_response_v1alpha1_llm_response_types_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_tim_api_llm_response_v1alpha1_llm_response_types_proto_rawDesc), len(file_tim_api_llm_response_v1alpha1_llm_response_types_proto_rawDesc))) +func file_tim_int_llm_response_v1alpha1_llm_response_types_proto_rawDescGZIP() []byte { + file_tim_int_llm_response_v1alpha1_llm_response_types_proto_rawDescOnce.Do(func() { + file_tim_int_llm_response_v1alpha1_llm_response_types_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_tim_int_llm_response_v1alpha1_llm_response_types_proto_rawDesc), len(file_tim_int_llm_response_v1alpha1_llm_response_types_proto_rawDesc))) }) - return file_tim_api_llm_response_v1alpha1_llm_response_types_proto_rawDescData -} - -var file_tim_api_llm_response_v1alpha1_llm_response_types_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_tim_api_llm_response_v1alpha1_llm_response_types_proto_msgTypes = make([]protoimpl.MessageInfo, 7) -var file_tim_api_llm_response_v1alpha1_llm_response_types_proto_goTypes = []any{ - (ContentBlockType)(0), // 0: tim.api.llm_response.v1alpha1.ContentBlockType - (MessageStop_StopReason)(0), // 1: tim.api.llm_response.v1alpha1.MessageStop.StopReason - (*LlmResponseEvent)(nil), // 2: tim.api.llm_response.v1alpha1.LlmResponseEvent - (*MessageStart)(nil), // 3: tim.api.llm_response.v1alpha1.MessageStart - (*MessageStop)(nil), // 4: tim.api.llm_response.v1alpha1.MessageStop - (*ContentBlockStart)(nil), // 5: tim.api.llm_response.v1alpha1.ContentBlockStart - (*ContentBlockDelta)(nil), // 6: tim.api.llm_response.v1alpha1.ContentBlockDelta - (*ContentBlockStop)(nil), // 7: tim.api.llm_response.v1alpha1.ContentBlockStop - (*TokenUsage)(nil), // 8: tim.api.llm_response.v1alpha1.TokenUsage -} -var file_tim_api_llm_response_v1alpha1_llm_response_types_proto_depIdxs = []int32{ - 3, // 0: tim.api.llm_response.v1alpha1.LlmResponseEvent.message_start:type_name -> tim.api.llm_response.v1alpha1.MessageStart - 4, // 1: tim.api.llm_response.v1alpha1.LlmResponseEvent.message_stop:type_name -> tim.api.llm_response.v1alpha1.MessageStop - 5, // 2: tim.api.llm_response.v1alpha1.LlmResponseEvent.content_block_start:type_name -> tim.api.llm_response.v1alpha1.ContentBlockStart - 6, // 3: tim.api.llm_response.v1alpha1.LlmResponseEvent.content_block_delta:type_name -> tim.api.llm_response.v1alpha1.ContentBlockDelta - 7, // 4: tim.api.llm_response.v1alpha1.LlmResponseEvent.content_block_stop:type_name -> tim.api.llm_response.v1alpha1.ContentBlockStop - 1, // 5: tim.api.llm_response.v1alpha1.MessageStop.reason:type_name -> tim.api.llm_response.v1alpha1.MessageStop.StopReason - 0, // 6: tim.api.llm_response.v1alpha1.ContentBlockStart.type:type_name -> tim.api.llm_response.v1alpha1.ContentBlockType - 0, // 7: tim.api.llm_response.v1alpha1.ContentBlockDelta.type:type_name -> tim.api.llm_response.v1alpha1.ContentBlockType - 0, // 8: tim.api.llm_response.v1alpha1.ContentBlockStop.type:type_name -> tim.api.llm_response.v1alpha1.ContentBlockType + return file_tim_int_llm_response_v1alpha1_llm_response_types_proto_rawDescData +} + +var file_tim_int_llm_response_v1alpha1_llm_response_types_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_tim_int_llm_response_v1alpha1_llm_response_types_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +var file_tim_int_llm_response_v1alpha1_llm_response_types_proto_goTypes = []any{ + (ContentBlockType)(0), // 0: tim.int.llm_response.v1alpha1.ContentBlockType + (MessageStop_StopReason)(0), // 1: tim.int.llm_response.v1alpha1.MessageStop.StopReason + (*LlmResponseEvent)(nil), // 2: tim.int.llm_response.v1alpha1.LlmResponseEvent + (*MessageStart)(nil), // 3: tim.int.llm_response.v1alpha1.MessageStart + (*MessageStop)(nil), // 4: tim.int.llm_response.v1alpha1.MessageStop + (*ContentBlockStart)(nil), // 5: tim.int.llm_response.v1alpha1.ContentBlockStart + (*ContentBlockDelta)(nil), // 6: tim.int.llm_response.v1alpha1.ContentBlockDelta + (*ContentBlockStop)(nil), // 7: tim.int.llm_response.v1alpha1.ContentBlockStop + (*TokenUsage)(nil), // 8: tim.int.llm_response.v1alpha1.TokenUsage +} +var file_tim_int_llm_response_v1alpha1_llm_response_types_proto_depIdxs = []int32{ + 3, // 0: tim.int.llm_response.v1alpha1.LlmResponseEvent.message_start:type_name -> tim.int.llm_response.v1alpha1.MessageStart + 4, // 1: tim.int.llm_response.v1alpha1.LlmResponseEvent.message_stop:type_name -> tim.int.llm_response.v1alpha1.MessageStop + 5, // 2: tim.int.llm_response.v1alpha1.LlmResponseEvent.content_block_start:type_name -> tim.int.llm_response.v1alpha1.ContentBlockStart + 6, // 3: tim.int.llm_response.v1alpha1.LlmResponseEvent.content_block_delta:type_name -> tim.int.llm_response.v1alpha1.ContentBlockDelta + 7, // 4: tim.int.llm_response.v1alpha1.LlmResponseEvent.content_block_stop:type_name -> tim.int.llm_response.v1alpha1.ContentBlockStop + 1, // 5: tim.int.llm_response.v1alpha1.MessageStop.reason:type_name -> tim.int.llm_response.v1alpha1.MessageStop.StopReason + 0, // 6: tim.int.llm_response.v1alpha1.ContentBlockStart.type:type_name -> tim.int.llm_response.v1alpha1.ContentBlockType + 0, // 7: tim.int.llm_response.v1alpha1.ContentBlockDelta.type:type_name -> tim.int.llm_response.v1alpha1.ContentBlockType + 0, // 8: tim.int.llm_response.v1alpha1.ContentBlockStop.type:type_name -> tim.int.llm_response.v1alpha1.ContentBlockType 9, // [9:9] is the sub-list for method output_type 9, // [9:9] is the sub-list for method input_type 9, // [9:9] is the sub-list for extension type_name @@ -770,12 +770,12 @@ var file_tim_api_llm_response_v1alpha1_llm_response_types_proto_depIdxs = []int3 0, // [0:9] is the sub-list for field type_name } -func init() { file_tim_api_llm_response_v1alpha1_llm_response_types_proto_init() } -func file_tim_api_llm_response_v1alpha1_llm_response_types_proto_init() { - if File_tim_api_llm_response_v1alpha1_llm_response_types_proto != nil { +func init() { file_tim_int_llm_response_v1alpha1_llm_response_types_proto_init() } +func file_tim_int_llm_response_v1alpha1_llm_response_types_proto_init() { + if File_tim_int_llm_response_v1alpha1_llm_response_types_proto != nil { return } - file_tim_api_llm_response_v1alpha1_llm_response_types_proto_msgTypes[0].OneofWrappers = []any{ + file_tim_int_llm_response_v1alpha1_llm_response_types_proto_msgTypes[0].OneofWrappers = []any{ (*LlmResponseEvent_MessageStart)(nil), (*LlmResponseEvent_MessageStop)(nil), (*LlmResponseEvent_ContentBlockStart)(nil), @@ -786,18 +786,18 @@ func file_tim_api_llm_response_v1alpha1_llm_response_types_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_tim_api_llm_response_v1alpha1_llm_response_types_proto_rawDesc), len(file_tim_api_llm_response_v1alpha1_llm_response_types_proto_rawDesc)), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_tim_int_llm_response_v1alpha1_llm_response_types_proto_rawDesc), len(file_tim_int_llm_response_v1alpha1_llm_response_types_proto_rawDesc)), NumEnums: 2, NumMessages: 7, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_tim_api_llm_response_v1alpha1_llm_response_types_proto_goTypes, - DependencyIndexes: file_tim_api_llm_response_v1alpha1_llm_response_types_proto_depIdxs, - EnumInfos: file_tim_api_llm_response_v1alpha1_llm_response_types_proto_enumTypes, - MessageInfos: file_tim_api_llm_response_v1alpha1_llm_response_types_proto_msgTypes, + GoTypes: file_tim_int_llm_response_v1alpha1_llm_response_types_proto_goTypes, + DependencyIndexes: file_tim_int_llm_response_v1alpha1_llm_response_types_proto_depIdxs, + EnumInfos: file_tim_int_llm_response_v1alpha1_llm_response_types_proto_enumTypes, + MessageInfos: file_tim_int_llm_response_v1alpha1_llm_response_types_proto_msgTypes, }.Build() - File_tim_api_llm_response_v1alpha1_llm_response_types_proto = out.File - file_tim_api_llm_response_v1alpha1_llm_response_types_proto_goTypes = nil - file_tim_api_llm_response_v1alpha1_llm_response_types_proto_depIdxs = nil + File_tim_int_llm_response_v1alpha1_llm_response_types_proto = out.File + file_tim_int_llm_response_v1alpha1_llm_response_types_proto_goTypes = nil + file_tim_int_llm_response_v1alpha1_llm_response_types_proto_depIdxs = nil } diff --git a/tim-proto/gen/tim/api/llm_response/v1alpha1/llm_response_types.swagger.json b/tim-proto/gen/tim/int/llm_response/v1alpha1/llm_response_types.swagger.json similarity index 98% rename from tim-proto/gen/tim/api/llm_response/v1alpha1/llm_response_types.swagger.json rename to tim-proto/gen/tim/int/llm_response/v1alpha1/llm_response_types.swagger.json index b50ee80b9..4875f3daa 100644 --- a/tim-proto/gen/tim/api/llm_response/v1alpha1/llm_response_types.swagger.json +++ b/tim-proto/gen/tim/int/llm_response/v1alpha1/llm_response_types.swagger.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "title": "tim/api/llm_response/v1alpha1/llm_response_types.proto", + "title": "tim/int/llm_response/v1alpha1/llm_response_types.proto", "version": "version not set" }, "consumes": [ diff --git a/tim-proto/gen/tim/api/llm_response/v1alpha1/llm_responsev1alpha1connect/llm_response_service.connect.go b/tim-proto/gen/tim/int/llm_response/v1alpha1/llm_responsev1alpha1connect/llm_response_service.connect.go similarity index 87% rename from tim-proto/gen/tim/api/llm_response/v1alpha1/llm_responsev1alpha1connect/llm_response_service.connect.go rename to tim-proto/gen/tim/int/llm_response/v1alpha1/llm_responsev1alpha1connect/llm_response_service.connect.go index e58c94063..2ff196307 100644 --- a/tim-proto/gen/tim/api/llm_response/v1alpha1/llm_responsev1alpha1connect/llm_response_service.connect.go +++ b/tim-proto/gen/tim/int/llm_response/v1alpha1/llm_responsev1alpha1connect/llm_response_service.connect.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-connect-go. DO NOT EDIT. // -// Source: tim/api/llm_response/v1alpha1/llm_response_service.proto +// Source: tim/int/llm_response/v1alpha1/llm_response_service.proto package llm_responsev1alpha1connect @@ -8,7 +8,7 @@ import ( connect "connectrpc.com/connect" context "context" errors "errors" - v1alpha1 "github.com/Greybox-Labs/tim/tim-proto/gen/tim/api/llm_response/v1alpha1" + v1alpha1 "github.com/Greybox-Labs/tim/tim-proto/gen/tim/int/llm_response/v1alpha1" http "net/http" strings "strings" ) @@ -22,7 +22,7 @@ const _ = connect.IsAtLeastVersion1_13_0 const ( // LlmResponseServiceName is the fully-qualified name of the LlmResponseService service. - LlmResponseServiceName = "tim.api.llm_response.v1alpha1.LlmResponseService" + LlmResponseServiceName = "tim.int.llm_response.v1alpha1.LlmResponseService" ) // These constants are the fully-qualified names of the RPCs defined in this package. They're @@ -35,26 +35,25 @@ const ( const ( // LlmResponseServiceUploadLlmResponseEventsProcedure is the fully-qualified name of the // LlmResponseService's UploadLlmResponseEvents RPC. - LlmResponseServiceUploadLlmResponseEventsProcedure = "/tim.api.llm_response.v1alpha1.LlmResponseService/UploadLlmResponseEvents" + LlmResponseServiceUploadLlmResponseEventsProcedure = "/tim.int.llm_response.v1alpha1.LlmResponseService/UploadLlmResponseEvents" // LlmResponseServicePushLlmTokenUsageProcedure is the fully-qualified name of the // LlmResponseService's PushLlmTokenUsage RPC. - LlmResponseServicePushLlmTokenUsageProcedure = "/tim.api.llm_response.v1alpha1.LlmResponseService/PushLlmTokenUsage" + LlmResponseServicePushLlmTokenUsageProcedure = "/tim.int.llm_response.v1alpha1.LlmResponseService/PushLlmTokenUsage" ) -// LlmResponseServiceClient is a client for the tim.api.llm_response.v1alpha1.LlmResponseService +// LlmResponseServiceClient is a client for the tim.int.llm_response.v1alpha1.LlmResponseService // service. type LlmResponseServiceClient interface { // Upload llm response events to the server // Note: Client streaming RPCs cannot have HTTP annotations with path parameters // This RPC is gRPC-only and excluded from HTTP/REST API generation - // buf:lint:ignore AEP_0127_HTTP_ANNOTATION_REQUIRED UploadLlmResponseEvents(context.Context) *connect.ClientStreamForClient[v1alpha1.UploadLlmResponseEventsRequest, v1alpha1.UploadLlmResponseEventsResponse] // Provide the token usage for an LLM message PushLlmTokenUsage(context.Context, *connect.Request[v1alpha1.PushLlmTokenUsageRequest]) (*connect.Response[v1alpha1.PushLlmTokenUsageResponse], error) } // NewLlmResponseServiceClient constructs a client for the -// tim.api.llm_response.v1alpha1.LlmResponseService service. By default, it uses the Connect +// tim.int.llm_response.v1alpha1.LlmResponseService service. By default, it uses the Connect // protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed // requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or // connect.WithGRPCWeb() options. @@ -63,7 +62,7 @@ type LlmResponseServiceClient interface { // http://api.acme.com or https://acme.com/grpc). func NewLlmResponseServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) LlmResponseServiceClient { baseURL = strings.TrimRight(baseURL, "/") - llmResponseServiceMethods := v1alpha1.File_tim_api_llm_response_v1alpha1_llm_response_service_proto.Services().ByName("LlmResponseService").Methods() + llmResponseServiceMethods := v1alpha1.File_tim_int_llm_response_v1alpha1_llm_response_service_proto.Services().ByName("LlmResponseService").Methods() return &llmResponseServiceClient{ uploadLlmResponseEvents: connect.NewClient[v1alpha1.UploadLlmResponseEventsRequest, v1alpha1.UploadLlmResponseEventsResponse]( httpClient, @@ -87,23 +86,22 @@ type llmResponseServiceClient struct { } // UploadLlmResponseEvents calls -// tim.api.llm_response.v1alpha1.LlmResponseService.UploadLlmResponseEvents. +// tim.int.llm_response.v1alpha1.LlmResponseService.UploadLlmResponseEvents. func (c *llmResponseServiceClient) UploadLlmResponseEvents(ctx context.Context) *connect.ClientStreamForClient[v1alpha1.UploadLlmResponseEventsRequest, v1alpha1.UploadLlmResponseEventsResponse] { return c.uploadLlmResponseEvents.CallClientStream(ctx) } -// PushLlmTokenUsage calls tim.api.llm_response.v1alpha1.LlmResponseService.PushLlmTokenUsage. +// PushLlmTokenUsage calls tim.int.llm_response.v1alpha1.LlmResponseService.PushLlmTokenUsage. func (c *llmResponseServiceClient) PushLlmTokenUsage(ctx context.Context, req *connect.Request[v1alpha1.PushLlmTokenUsageRequest]) (*connect.Response[v1alpha1.PushLlmTokenUsageResponse], error) { return c.pushLlmTokenUsage.CallUnary(ctx, req) } // LlmResponseServiceHandler is an implementation of the -// tim.api.llm_response.v1alpha1.LlmResponseService service. +// tim.int.llm_response.v1alpha1.LlmResponseService service. type LlmResponseServiceHandler interface { // Upload llm response events to the server // Note: Client streaming RPCs cannot have HTTP annotations with path parameters // This RPC is gRPC-only and excluded from HTTP/REST API generation - // buf:lint:ignore AEP_0127_HTTP_ANNOTATION_REQUIRED UploadLlmResponseEvents(context.Context, *connect.ClientStream[v1alpha1.UploadLlmResponseEventsRequest]) (*connect.Response[v1alpha1.UploadLlmResponseEventsResponse], error) // Provide the token usage for an LLM message PushLlmTokenUsage(context.Context, *connect.Request[v1alpha1.PushLlmTokenUsageRequest]) (*connect.Response[v1alpha1.PushLlmTokenUsageResponse], error) @@ -115,7 +113,7 @@ type LlmResponseServiceHandler interface { // By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf // and JSON codecs. They also support gzip compression. func NewLlmResponseServiceHandler(svc LlmResponseServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { - llmResponseServiceMethods := v1alpha1.File_tim_api_llm_response_v1alpha1_llm_response_service_proto.Services().ByName("LlmResponseService").Methods() + llmResponseServiceMethods := v1alpha1.File_tim_int_llm_response_v1alpha1_llm_response_service_proto.Services().ByName("LlmResponseService").Methods() llmResponseServiceUploadLlmResponseEventsHandler := connect.NewClientStreamHandler( LlmResponseServiceUploadLlmResponseEventsProcedure, svc.UploadLlmResponseEvents, @@ -128,7 +126,7 @@ func NewLlmResponseServiceHandler(svc LlmResponseServiceHandler, opts ...connect connect.WithSchema(llmResponseServiceMethods.ByName("PushLlmTokenUsage")), connect.WithHandlerOptions(opts...), ) - return "/tim.api.llm_response.v1alpha1.LlmResponseService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + return "/tim.int.llm_response.v1alpha1.LlmResponseService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { switch r.URL.Path { case LlmResponseServiceUploadLlmResponseEventsProcedure: llmResponseServiceUploadLlmResponseEventsHandler.ServeHTTP(w, r) @@ -144,9 +142,9 @@ func NewLlmResponseServiceHandler(svc LlmResponseServiceHandler, opts ...connect type UnimplementedLlmResponseServiceHandler struct{} func (UnimplementedLlmResponseServiceHandler) UploadLlmResponseEvents(context.Context, *connect.ClientStream[v1alpha1.UploadLlmResponseEventsRequest]) (*connect.Response[v1alpha1.UploadLlmResponseEventsResponse], error) { - return nil, connect.NewError(connect.CodeUnimplemented, errors.New("tim.api.llm_response.v1alpha1.LlmResponseService.UploadLlmResponseEvents is not implemented")) + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("tim.int.llm_response.v1alpha1.LlmResponseService.UploadLlmResponseEvents is not implemented")) } func (UnimplementedLlmResponseServiceHandler) PushLlmTokenUsage(context.Context, *connect.Request[v1alpha1.PushLlmTokenUsageRequest]) (*connect.Response[v1alpha1.PushLlmTokenUsageResponse], error) { - return nil, connect.NewError(connect.CodeUnimplemented, errors.New("tim.api.llm_response.v1alpha1.LlmResponseService.PushLlmTokenUsage is not implemented")) + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("tim.int.llm_response.v1alpha1.LlmResponseService.PushLlmTokenUsage is not implemented")) } diff --git a/tim-proto/gen/tim/api/thread_context/v1alpha1/thread_context_service.pb.go b/tim-proto/gen/tim/int/thread_context/v1alpha1/thread_context_service.pb.go similarity index 51% rename from tim-proto/gen/tim/api/thread_context/v1alpha1/thread_context_service.pb.go rename to tim-proto/gen/tim/int/thread_context/v1alpha1/thread_context_service.pb.go index fea4f9ff7..6e19caa4a 100644 --- a/tim-proto/gen/tim/api/thread_context/v1alpha1/thread_context_service.pb.go +++ b/tim-proto/gen/tim/int/thread_context/v1alpha1/thread_context_service.pb.go @@ -2,7 +2,7 @@ // versions: // protoc-gen-go v1.36.9 // protoc (unknown) -// source: tim/api/thread_context/v1alpha1/thread_context_service.proto +// source: tim/int/thread_context/v1alpha1/thread_context_service.proto package thread_contextv1alpha1 @@ -35,7 +35,7 @@ type GetThreadContextRequest struct { func (x *GetThreadContextRequest) Reset() { *x = GetThreadContextRequest{} - mi := &file_tim_api_thread_context_v1alpha1_thread_context_service_proto_msgTypes[0] + mi := &file_tim_int_thread_context_v1alpha1_thread_context_service_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -47,7 +47,7 @@ func (x *GetThreadContextRequest) String() string { func (*GetThreadContextRequest) ProtoMessage() {} func (x *GetThreadContextRequest) ProtoReflect() protoreflect.Message { - mi := &file_tim_api_thread_context_v1alpha1_thread_context_service_proto_msgTypes[0] + mi := &file_tim_int_thread_context_v1alpha1_thread_context_service_proto_msgTypes[0] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -60,7 +60,7 @@ func (x *GetThreadContextRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetThreadContextRequest.ProtoReflect.Descriptor instead. func (*GetThreadContextRequest) Descriptor() ([]byte, []int) { - return file_tim_api_thread_context_v1alpha1_thread_context_service_proto_rawDescGZIP(), []int{0} + return file_tim_int_thread_context_v1alpha1_thread_context_service_proto_rawDescGZIP(), []int{0} } func (x *GetThreadContextRequest) GetPath() string { @@ -70,37 +70,37 @@ func (x *GetThreadContextRequest) GetPath() string { return "" } -var File_tim_api_thread_context_v1alpha1_thread_context_service_proto protoreflect.FileDescriptor +var File_tim_int_thread_context_v1alpha1_thread_context_service_proto protoreflect.FileDescriptor -const file_tim_api_thread_context_v1alpha1_thread_context_service_proto_rawDesc = "" + +const file_tim_int_thread_context_v1alpha1_thread_context_service_proto_rawDesc = "" + "\n" + - " tim.api.thread_context.v1alpha1.GetThreadContextRequest - 1, // 1: tim.api.thread_context.v1alpha1.ThreadContextService.GetThreadContext:output_type -> tim.api.thread_context.v1alpha1.ThreadContext +var file_tim_int_thread_context_v1alpha1_thread_context_service_proto_depIdxs = []int32{ + 0, // 0: tim.int.thread_context.v1alpha1.ThreadContextService.GetThreadContext:input_type -> tim.int.thread_context.v1alpha1.GetThreadContextRequest + 1, // 1: tim.int.thread_context.v1alpha1.ThreadContextService.GetThreadContext:output_type -> tim.int.thread_context.v1alpha1.ThreadContext 1, // [1:2] is the sub-list for method output_type 0, // [0:1] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name @@ -108,27 +108,27 @@ var file_tim_api_thread_context_v1alpha1_thread_context_service_proto_depIdxs = 0, // [0:0] is the sub-list for field type_name } -func init() { file_tim_api_thread_context_v1alpha1_thread_context_service_proto_init() } -func file_tim_api_thread_context_v1alpha1_thread_context_service_proto_init() { - if File_tim_api_thread_context_v1alpha1_thread_context_service_proto != nil { +func init() { file_tim_int_thread_context_v1alpha1_thread_context_service_proto_init() } +func file_tim_int_thread_context_v1alpha1_thread_context_service_proto_init() { + if File_tim_int_thread_context_v1alpha1_thread_context_service_proto != nil { return } - file_tim_api_thread_context_v1alpha1_thread_context_types_proto_init() + file_tim_int_thread_context_v1alpha1_thread_context_types_proto_init() type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_tim_api_thread_context_v1alpha1_thread_context_service_proto_rawDesc), len(file_tim_api_thread_context_v1alpha1_thread_context_service_proto_rawDesc)), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_tim_int_thread_context_v1alpha1_thread_context_service_proto_rawDesc), len(file_tim_int_thread_context_v1alpha1_thread_context_service_proto_rawDesc)), NumEnums: 0, NumMessages: 1, NumExtensions: 0, NumServices: 1, }, - GoTypes: file_tim_api_thread_context_v1alpha1_thread_context_service_proto_goTypes, - DependencyIndexes: file_tim_api_thread_context_v1alpha1_thread_context_service_proto_depIdxs, - MessageInfos: file_tim_api_thread_context_v1alpha1_thread_context_service_proto_msgTypes, + GoTypes: file_tim_int_thread_context_v1alpha1_thread_context_service_proto_goTypes, + DependencyIndexes: file_tim_int_thread_context_v1alpha1_thread_context_service_proto_depIdxs, + MessageInfos: file_tim_int_thread_context_v1alpha1_thread_context_service_proto_msgTypes, }.Build() - File_tim_api_thread_context_v1alpha1_thread_context_service_proto = out.File - file_tim_api_thread_context_v1alpha1_thread_context_service_proto_goTypes = nil - file_tim_api_thread_context_v1alpha1_thread_context_service_proto_depIdxs = nil + File_tim_int_thread_context_v1alpha1_thread_context_service_proto = out.File + file_tim_int_thread_context_v1alpha1_thread_context_service_proto_goTypes = nil + file_tim_int_thread_context_v1alpha1_thread_context_service_proto_depIdxs = nil } diff --git a/tim-proto/gen/tim/api/thread_context/v1alpha1/thread_context_service.swagger.json b/tim-proto/gen/tim/int/thread_context/v1alpha1/thread_context_service.swagger.json similarity index 92% rename from tim-proto/gen/tim/api/thread_context/v1alpha1/thread_context_service.swagger.json rename to tim-proto/gen/tim/int/thread_context/v1alpha1/thread_context_service.swagger.json index 5ac0932ad..6d2cf9cf2 100644 --- a/tim-proto/gen/tim/api/thread_context/v1alpha1/thread_context_service.swagger.json +++ b/tim-proto/gen/tim/int/thread_context/v1alpha1/thread_context_service.swagger.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "title": "tim/api/thread_context/v1alpha1/thread_context_service.proto", + "title": "tim/int/thread_context/v1alpha1/thread_context_service.proto", "version": "version not set" }, "tags": [ @@ -15,42 +15,34 @@ "produces": [ "application/json" ], - "paths": { - "/v1alpha1/{path}/context": { - "get": { - "summary": "Get a thread's active context", - "operationId": "ThreadContextService_GetThreadContext", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1alpha1ThreadContext" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "path", - "description": "The resource path of the thread", - "in": "path", - "required": true, - "type": "string", - "pattern": "orgs/[^/]+/users/[^/]+/threads/[^/]+" - } - ], - "tags": [ - "ThreadContextService" - ] - } - } - }, + "paths": {}, "definitions": { + "apithreadv1alpha1TokenUsage": { + "type": "object", + "properties": { + "inputTokens": { + "type": "string", + "format": "int64", + "description": "The number of input tokens." + }, + "outputTokens": { + "type": "string", + "format": "int64", + "description": "The number of output tokens." + }, + "cacheCreateTokens": { + "type": "string", + "format": "int64", + "description": "The number of cache create tokens." + }, + "cacheReadTokens": { + "type": "string", + "format": "int64", + "description": "The number of cache read tokens." + } + }, + "title": "TokenUsage is the usage of tokens for an llm call.\nThis is a user facing version of the internal TokenUsage message" + }, "apitoolv1alpha1ToolCall": { "type": "object", "properties": { @@ -162,7 +154,7 @@ "readOnly": true }, "tokenUsage": { - "$ref": "#/definitions/v1alpha1TokenUsage", + "$ref": "#/definitions/apithreadv1alpha1TokenUsage", "title": "Token usage for this message (optional, set after LLM response)", "readOnly": true } @@ -286,32 +278,6 @@ }, "title": "ThreadContext is a collection of active context for a thread" }, - "v1alpha1TokenUsage": { - "type": "object", - "properties": { - "inputTokens": { - "type": "string", - "format": "int64", - "description": "The number of input tokens." - }, - "outputTokens": { - "type": "string", - "format": "int64", - "description": "The number of output tokens." - }, - "cacheCreateTokens": { - "type": "string", - "format": "int64", - "description": "The number of cache create tokens." - }, - "cacheReadTokens": { - "type": "string", - "format": "int64", - "description": "The number of cache read tokens." - } - }, - "description": "TokenUsage is the usage of tokens for an llm call." - }, "v1alpha1ToolChoice": { "type": "object", "properties": { diff --git a/tim-proto/gen/tim/api/thread_context/v1alpha1/thread_context_types.pb.go b/tim-proto/gen/tim/int/thread_context/v1alpha1/thread_context_types.pb.go similarity index 75% rename from tim-proto/gen/tim/api/thread_context/v1alpha1/thread_context_types.pb.go rename to tim-proto/gen/tim/int/thread_context/v1alpha1/thread_context_types.pb.go index b0ecf501b..902477235 100644 --- a/tim-proto/gen/tim/api/thread_context/v1alpha1/thread_context_types.pb.go +++ b/tim-proto/gen/tim/int/thread_context/v1alpha1/thread_context_types.pb.go @@ -2,7 +2,7 @@ // versions: // protoc-gen-go v1.36.9 // protoc (unknown) -// source: tim/api/thread_context/v1alpha1/thread_context_types.proto +// source: tim/int/thread_context/v1alpha1/thread_context_types.proto package thread_contextv1alpha1 @@ -52,7 +52,7 @@ type ThreadContext struct { func (x *ThreadContext) Reset() { *x = ThreadContext{} - mi := &file_tim_api_thread_context_v1alpha1_thread_context_types_proto_msgTypes[0] + mi := &file_tim_int_thread_context_v1alpha1_thread_context_types_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -64,7 +64,7 @@ func (x *ThreadContext) String() string { func (*ThreadContext) ProtoMessage() {} func (x *ThreadContext) ProtoReflect() protoreflect.Message { - mi := &file_tim_api_thread_context_v1alpha1_thread_context_types_proto_msgTypes[0] + mi := &file_tim_int_thread_context_v1alpha1_thread_context_types_proto_msgTypes[0] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -77,7 +77,7 @@ func (x *ThreadContext) ProtoReflect() protoreflect.Message { // Deprecated: Use ThreadContext.ProtoReflect.Descriptor instead. func (*ThreadContext) Descriptor() ([]byte, []int) { - return file_tim_api_thread_context_v1alpha1_thread_context_types_proto_rawDescGZIP(), []int{0} + return file_tim_int_thread_context_v1alpha1_thread_context_types_proto_rawDescGZIP(), []int{0} } func (x *ThreadContext) GetModel() string { @@ -158,7 +158,7 @@ type Tool struct { func (x *Tool) Reset() { *x = Tool{} - mi := &file_tim_api_thread_context_v1alpha1_thread_context_types_proto_msgTypes[1] + mi := &file_tim_int_thread_context_v1alpha1_thread_context_types_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -170,7 +170,7 @@ func (x *Tool) String() string { func (*Tool) ProtoMessage() {} func (x *Tool) ProtoReflect() protoreflect.Message { - mi := &file_tim_api_thread_context_v1alpha1_thread_context_types_proto_msgTypes[1] + mi := &file_tim_int_thread_context_v1alpha1_thread_context_types_proto_msgTypes[1] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -183,7 +183,7 @@ func (x *Tool) ProtoReflect() protoreflect.Message { // Deprecated: Use Tool.ProtoReflect.Descriptor instead. func (*Tool) Descriptor() ([]byte, []int) { - return file_tim_api_thread_context_v1alpha1_thread_context_types_proto_rawDescGZIP(), []int{1} + return file_tim_int_thread_context_v1alpha1_thread_context_types_proto_rawDescGZIP(), []int{1} } func (x *Tool) GetName() string { @@ -220,7 +220,7 @@ type ToolInputSchema struct { func (x *ToolInputSchema) Reset() { *x = ToolInputSchema{} - mi := &file_tim_api_thread_context_v1alpha1_thread_context_types_proto_msgTypes[2] + mi := &file_tim_int_thread_context_v1alpha1_thread_context_types_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -232,7 +232,7 @@ func (x *ToolInputSchema) String() string { func (*ToolInputSchema) ProtoMessage() {} func (x *ToolInputSchema) ProtoReflect() protoreflect.Message { - mi := &file_tim_api_thread_context_v1alpha1_thread_context_types_proto_msgTypes[2] + mi := &file_tim_int_thread_context_v1alpha1_thread_context_types_proto_msgTypes[2] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -245,7 +245,7 @@ func (x *ToolInputSchema) ProtoReflect() protoreflect.Message { // Deprecated: Use ToolInputSchema.ProtoReflect.Descriptor instead. func (*ToolInputSchema) Descriptor() ([]byte, []int) { - return file_tim_api_thread_context_v1alpha1_thread_context_types_proto_rawDescGZIP(), []int{2} + return file_tim_int_thread_context_v1alpha1_thread_context_types_proto_rawDescGZIP(), []int{2} } func (x *ToolInputSchema) GetProperties() map[string]*anypb.Any { @@ -278,7 +278,7 @@ type ToolChoice struct { func (x *ToolChoice) Reset() { *x = ToolChoice{} - mi := &file_tim_api_thread_context_v1alpha1_thread_context_types_proto_msgTypes[3] + mi := &file_tim_int_thread_context_v1alpha1_thread_context_types_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -290,7 +290,7 @@ func (x *ToolChoice) String() string { func (*ToolChoice) ProtoMessage() {} func (x *ToolChoice) ProtoReflect() protoreflect.Message { - mi := &file_tim_api_thread_context_v1alpha1_thread_context_types_proto_msgTypes[3] + mi := &file_tim_int_thread_context_v1alpha1_thread_context_types_proto_msgTypes[3] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -303,7 +303,7 @@ func (x *ToolChoice) ProtoReflect() protoreflect.Message { // Deprecated: Use ToolChoice.ProtoReflect.Descriptor instead. func (*ToolChoice) Descriptor() ([]byte, []int) { - return file_tim_api_thread_context_v1alpha1_thread_context_types_proto_rawDescGZIP(), []int{3} + return file_tim_int_thread_context_v1alpha1_thread_context_types_proto_rawDescGZIP(), []int{3} } func (x *ToolChoice) GetData() isToolChoice_Data { @@ -392,7 +392,7 @@ type ToolChoiceAuto struct { func (x *ToolChoiceAuto) Reset() { *x = ToolChoiceAuto{} - mi := &file_tim_api_thread_context_v1alpha1_thread_context_types_proto_msgTypes[4] + mi := &file_tim_int_thread_context_v1alpha1_thread_context_types_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -404,7 +404,7 @@ func (x *ToolChoiceAuto) String() string { func (*ToolChoiceAuto) ProtoMessage() {} func (x *ToolChoiceAuto) ProtoReflect() protoreflect.Message { - mi := &file_tim_api_thread_context_v1alpha1_thread_context_types_proto_msgTypes[4] + mi := &file_tim_int_thread_context_v1alpha1_thread_context_types_proto_msgTypes[4] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -417,7 +417,7 @@ func (x *ToolChoiceAuto) ProtoReflect() protoreflect.Message { // Deprecated: Use ToolChoiceAuto.ProtoReflect.Descriptor instead. func (*ToolChoiceAuto) Descriptor() ([]byte, []int) { - return file_tim_api_thread_context_v1alpha1_thread_context_types_proto_rawDescGZIP(), []int{4} + return file_tim_int_thread_context_v1alpha1_thread_context_types_proto_rawDescGZIP(), []int{4} } func (x *ToolChoiceAuto) GetParallelToolUse() bool { @@ -438,7 +438,7 @@ type ToolChoiceRequired struct { func (x *ToolChoiceRequired) Reset() { *x = ToolChoiceRequired{} - mi := &file_tim_api_thread_context_v1alpha1_thread_context_types_proto_msgTypes[5] + mi := &file_tim_int_thread_context_v1alpha1_thread_context_types_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -450,7 +450,7 @@ func (x *ToolChoiceRequired) String() string { func (*ToolChoiceRequired) ProtoMessage() {} func (x *ToolChoiceRequired) ProtoReflect() protoreflect.Message { - mi := &file_tim_api_thread_context_v1alpha1_thread_context_types_proto_msgTypes[5] + mi := &file_tim_int_thread_context_v1alpha1_thread_context_types_proto_msgTypes[5] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -463,7 +463,7 @@ func (x *ToolChoiceRequired) ProtoReflect() protoreflect.Message { // Deprecated: Use ToolChoiceRequired.ProtoReflect.Descriptor instead. func (*ToolChoiceRequired) Descriptor() ([]byte, []int) { - return file_tim_api_thread_context_v1alpha1_thread_context_types_proto_rawDescGZIP(), []int{5} + return file_tim_int_thread_context_v1alpha1_thread_context_types_proto_rawDescGZIP(), []int{5} } func (x *ToolChoiceRequired) GetParallelToolUse() bool { @@ -484,7 +484,7 @@ type ToolChoiceTool struct { func (x *ToolChoiceTool) Reset() { *x = ToolChoiceTool{} - mi := &file_tim_api_thread_context_v1alpha1_thread_context_types_proto_msgTypes[6] + mi := &file_tim_int_thread_context_v1alpha1_thread_context_types_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -496,7 +496,7 @@ func (x *ToolChoiceTool) String() string { func (*ToolChoiceTool) ProtoMessage() {} func (x *ToolChoiceTool) ProtoReflect() protoreflect.Message { - mi := &file_tim_api_thread_context_v1alpha1_thread_context_types_proto_msgTypes[6] + mi := &file_tim_int_thread_context_v1alpha1_thread_context_types_proto_msgTypes[6] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -509,7 +509,7 @@ func (x *ToolChoiceTool) ProtoReflect() protoreflect.Message { // Deprecated: Use ToolChoiceTool.ProtoReflect.Descriptor instead. func (*ToolChoiceTool) Descriptor() ([]byte, []int) { - return file_tim_api_thread_context_v1alpha1_thread_context_types_proto_rawDescGZIP(), []int{6} + return file_tim_int_thread_context_v1alpha1_thread_context_types_proto_rawDescGZIP(), []int{6} } func (x *ToolChoiceTool) GetTool() string { @@ -528,7 +528,7 @@ type ToolChoiceNone struct { func (x *ToolChoiceNone) Reset() { *x = ToolChoiceNone{} - mi := &file_tim_api_thread_context_v1alpha1_thread_context_types_proto_msgTypes[7] + mi := &file_tim_int_thread_context_v1alpha1_thread_context_types_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -540,7 +540,7 @@ func (x *ToolChoiceNone) String() string { func (*ToolChoiceNone) ProtoMessage() {} func (x *ToolChoiceNone) ProtoReflect() protoreflect.Message { - mi := &file_tim_api_thread_context_v1alpha1_thread_context_types_proto_msgTypes[7] + mi := &file_tim_int_thread_context_v1alpha1_thread_context_types_proto_msgTypes[7] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -553,14 +553,14 @@ func (x *ToolChoiceNone) ProtoReflect() protoreflect.Message { // Deprecated: Use ToolChoiceNone.ProtoReflect.Descriptor instead. func (*ToolChoiceNone) Descriptor() ([]byte, []int) { - return file_tim_api_thread_context_v1alpha1_thread_context_types_proto_rawDescGZIP(), []int{7} + return file_tim_int_thread_context_v1alpha1_thread_context_types_proto_rawDescGZIP(), []int{7} } -var File_tim_api_thread_context_v1alpha1_thread_context_types_proto protoreflect.FileDescriptor +var File_tim_int_thread_context_v1alpha1_thread_context_types_proto protoreflect.FileDescriptor -const file_tim_api_thread_context_v1alpha1_thread_context_types_proto_rawDesc = "" + +const file_tim_int_thread_context_v1alpha1_thread_context_types_proto_rawDesc = "" + "\n" + - ":tim/api/thread_context/v1alpha1/thread_context_types.proto\x12\x1ftim.api.thread_context.v1alpha1\x1a\x1bbuf/validate/validate.proto\x1a\x19google/protobuf/any.proto\x1a*tim/api/thread/v1alpha1/thread_types.proto\"\xf8\x04\n" + + ":tim/int/thread_context/v1alpha1/thread_context_types.proto\x12\x1ftim.int.thread_context.v1alpha1\x1a\x1bbuf/validate/validate.proto\x1a\x19google/protobuf/any.proto\x1a*tim/api/thread/v1alpha1/thread_types.proto\"\xf8\x04\n" + "\rThreadContext\x12\x1c\n" + "\x05model\x18\x01 \x01(\tB\x06\xbaH\x03\xc8\x01\x01R\x05model\x12&\n" + "\n" + @@ -569,7 +569,7 @@ const file_tim_api_thread_context_v1alpha1_thread_context_types_proto_rawDesc = "\x0esystem_prompts\x18\x04 \x03(\tR\rsystemPrompts\x12L\n" + "\bmessages\x18\x05 \x03(\v2#.tim.api.thread.v1alpha1.LlmMessageB\v\xbaH\b\xc8\x01\x01\x92\x01\x02\b\x01R\bmessages\x12\x14\n" + "\x05tools\x18\x06 \x03(\tR\x05tools\x12T\n" + - "\vtool_choice\x18\a \x01(\v2+.tim.api.thread_context.v1alpha1.ToolChoiceB\x06\xbaH\x03\xc8\x01\x01R\n" + + "\vtool_choice\x18\a \x01(\v2+.tim.int.thread_context.v1alpha1.ToolChoiceB\x06\xbaH\x03\xc8\x01\x01R\n" + "toolChoice\x12\x1a\n" + "\bthinking\x18\b \x01(\bR\bthinking\x121\n" + "\x14interleaved_thinking\x18\t \x01(\bR\x13interleavedThinking:\xc6\x01\xbaH\xc2\x01\x1a\xbf\x01\n" + @@ -577,10 +577,10 @@ const file_tim_api_thread_context_v1alpha1_thread_context_types_proto_rawDesc = "\x04Tool\x12\x12\n" + "\x04name\x18\x01 \x01(\tR\x04name\x12 \n" + "\vdescription\x18\x02 \x01(\tR\vdescription\x12S\n" + - "\finput_schema\x18\x03 \x01(\v20.tim.api.thread_context.v1alpha1.ToolInputSchemaR\vinputSchema\"\xe4\x01\n" + + "\finput_schema\x18\x03 \x01(\v20.tim.int.thread_context.v1alpha1.ToolInputSchemaR\vinputSchema\"\xe4\x01\n" + "\x0fToolInputSchema\x12`\n" + "\n" + - "properties\x18\x01 \x03(\v2@.tim.api.thread_context.v1alpha1.ToolInputSchema.PropertiesEntryR\n" + + "properties\x18\x01 \x03(\v2@.tim.int.thread_context.v1alpha1.ToolInputSchema.PropertiesEntryR\n" + "properties\x12\x1a\n" + "\brequired\x18\x02 \x03(\tR\brequired\x1aS\n" + "\x0fPropertiesEntry\x12\x10\n" + @@ -588,10 +588,10 @@ const file_tim_api_thread_context_v1alpha1_thread_context_types_proto_rawDesc = "\x05value\x18\x02 \x01(\v2\x14.google.protobuf.AnyR\x05value:\x028\x01\"\xbc\x02\n" + "\n" + "ToolChoice\x12E\n" + - "\x04auto\x18\x01 \x01(\v2/.tim.api.thread_context.v1alpha1.ToolChoiceAutoH\x00R\x04auto\x12Q\n" + - "\brequired\x18\x02 \x01(\v23.tim.api.thread_context.v1alpha1.ToolChoiceRequiredH\x00R\brequired\x12E\n" + - "\x04tool\x18\x03 \x01(\v2/.tim.api.thread_context.v1alpha1.ToolChoiceToolH\x00R\x04tool\x12E\n" + - "\x04none\x18\x04 \x01(\v2/.tim.api.thread_context.v1alpha1.ToolChoiceNoneH\x00R\x04noneB\x06\n" + + "\x04auto\x18\x01 \x01(\v2/.tim.int.thread_context.v1alpha1.ToolChoiceAutoH\x00R\x04auto\x12Q\n" + + "\brequired\x18\x02 \x01(\v23.tim.int.thread_context.v1alpha1.ToolChoiceRequiredH\x00R\brequired\x12E\n" + + "\x04tool\x18\x03 \x01(\v2/.tim.int.thread_context.v1alpha1.ToolChoiceToolH\x00R\x04tool\x12E\n" + + "\x04none\x18\x04 \x01(\v2/.tim.int.thread_context.v1alpha1.ToolChoiceNoneH\x00R\x04noneB\x06\n" + "\x04data\"<\n" + "\x0eToolChoiceAuto\x12*\n" + "\x11parallel_tool_use\x18\x01 \x01(\bR\x0fparallelToolUse\"@\n" + @@ -599,45 +599,45 @@ const file_tim_api_thread_context_v1alpha1_thread_context_types_proto_rawDesc = "\x11parallel_tool_use\x18\x01 \x01(\bR\x0fparallelToolUse\",\n" + "\x0eToolChoiceTool\x12\x1a\n" + "\x04tool\x18\x01 \x01(\tB\x06\xbaH\x03\xc8\x01\x01R\x04tool\"\x10\n" + - "\x0eToolChoiceNoneB\xbb\x02\n" + - "#com.tim.api.thread_context.v1alpha1B\x17ThreadContextTypesProtoP\x01Z`github.com/Greybox-Labs/tim/tim-proto/gen/tim/api/thread_context/v1alpha1;thread_contextv1alpha1\xa2\x02\x03TAT\xaa\x02\x1eTim.Api.ThreadContext.V1alpha1\xca\x02\x1eTim\\Api\\ThreadContext\\V1alpha1\xe2\x02*Tim\\Api\\ThreadContext\\V1alpha1\\GPBMetadata\xea\x02!Tim::Api::ThreadContext::V1alpha1b\x06proto3" + "\x0eToolChoiceNoneB\xbd\x02\n" + + "#com.tim.int.thread_context.v1alpha1B\x17ThreadContextTypesProtoP\x01Z`github.com/Greybox-Labs/tim/tim-proto/gen/tim/int/thread_context/v1alpha1;thread_contextv1alpha1\xa2\x02\x03TIT\xaa\x02\x1eTim.Int.ThreadContext.V1alpha1\xca\x02\x1fTim\\Int_\\ThreadContext\\V1alpha1\xe2\x02+Tim\\Int_\\ThreadContext\\V1alpha1\\GPBMetadata\xea\x02!Tim::Int::ThreadContext::V1alpha1b\x06proto3" var ( - file_tim_api_thread_context_v1alpha1_thread_context_types_proto_rawDescOnce sync.Once - file_tim_api_thread_context_v1alpha1_thread_context_types_proto_rawDescData []byte + file_tim_int_thread_context_v1alpha1_thread_context_types_proto_rawDescOnce sync.Once + file_tim_int_thread_context_v1alpha1_thread_context_types_proto_rawDescData []byte ) -func file_tim_api_thread_context_v1alpha1_thread_context_types_proto_rawDescGZIP() []byte { - file_tim_api_thread_context_v1alpha1_thread_context_types_proto_rawDescOnce.Do(func() { - file_tim_api_thread_context_v1alpha1_thread_context_types_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_tim_api_thread_context_v1alpha1_thread_context_types_proto_rawDesc), len(file_tim_api_thread_context_v1alpha1_thread_context_types_proto_rawDesc))) +func file_tim_int_thread_context_v1alpha1_thread_context_types_proto_rawDescGZIP() []byte { + file_tim_int_thread_context_v1alpha1_thread_context_types_proto_rawDescOnce.Do(func() { + file_tim_int_thread_context_v1alpha1_thread_context_types_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_tim_int_thread_context_v1alpha1_thread_context_types_proto_rawDesc), len(file_tim_int_thread_context_v1alpha1_thread_context_types_proto_rawDesc))) }) - return file_tim_api_thread_context_v1alpha1_thread_context_types_proto_rawDescData -} - -var file_tim_api_thread_context_v1alpha1_thread_context_types_proto_msgTypes = make([]protoimpl.MessageInfo, 9) -var file_tim_api_thread_context_v1alpha1_thread_context_types_proto_goTypes = []any{ - (*ThreadContext)(nil), // 0: tim.api.thread_context.v1alpha1.ThreadContext - (*Tool)(nil), // 1: tim.api.thread_context.v1alpha1.Tool - (*ToolInputSchema)(nil), // 2: tim.api.thread_context.v1alpha1.ToolInputSchema - (*ToolChoice)(nil), // 3: tim.api.thread_context.v1alpha1.ToolChoice - (*ToolChoiceAuto)(nil), // 4: tim.api.thread_context.v1alpha1.ToolChoiceAuto - (*ToolChoiceRequired)(nil), // 5: tim.api.thread_context.v1alpha1.ToolChoiceRequired - (*ToolChoiceTool)(nil), // 6: tim.api.thread_context.v1alpha1.ToolChoiceTool - (*ToolChoiceNone)(nil), // 7: tim.api.thread_context.v1alpha1.ToolChoiceNone - nil, // 8: tim.api.thread_context.v1alpha1.ToolInputSchema.PropertiesEntry + return file_tim_int_thread_context_v1alpha1_thread_context_types_proto_rawDescData +} + +var file_tim_int_thread_context_v1alpha1_thread_context_types_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_tim_int_thread_context_v1alpha1_thread_context_types_proto_goTypes = []any{ + (*ThreadContext)(nil), // 0: tim.int.thread_context.v1alpha1.ThreadContext + (*Tool)(nil), // 1: tim.int.thread_context.v1alpha1.Tool + (*ToolInputSchema)(nil), // 2: tim.int.thread_context.v1alpha1.ToolInputSchema + (*ToolChoice)(nil), // 3: tim.int.thread_context.v1alpha1.ToolChoice + (*ToolChoiceAuto)(nil), // 4: tim.int.thread_context.v1alpha1.ToolChoiceAuto + (*ToolChoiceRequired)(nil), // 5: tim.int.thread_context.v1alpha1.ToolChoiceRequired + (*ToolChoiceTool)(nil), // 6: tim.int.thread_context.v1alpha1.ToolChoiceTool + (*ToolChoiceNone)(nil), // 7: tim.int.thread_context.v1alpha1.ToolChoiceNone + nil, // 8: tim.int.thread_context.v1alpha1.ToolInputSchema.PropertiesEntry (*v1alpha1.LlmMessage)(nil), // 9: tim.api.thread.v1alpha1.LlmMessage (*anypb.Any)(nil), // 10: google.protobuf.Any } -var file_tim_api_thread_context_v1alpha1_thread_context_types_proto_depIdxs = []int32{ - 9, // 0: tim.api.thread_context.v1alpha1.ThreadContext.messages:type_name -> tim.api.thread.v1alpha1.LlmMessage - 3, // 1: tim.api.thread_context.v1alpha1.ThreadContext.tool_choice:type_name -> tim.api.thread_context.v1alpha1.ToolChoice - 2, // 2: tim.api.thread_context.v1alpha1.Tool.input_schema:type_name -> tim.api.thread_context.v1alpha1.ToolInputSchema - 8, // 3: tim.api.thread_context.v1alpha1.ToolInputSchema.properties:type_name -> tim.api.thread_context.v1alpha1.ToolInputSchema.PropertiesEntry - 4, // 4: tim.api.thread_context.v1alpha1.ToolChoice.auto:type_name -> tim.api.thread_context.v1alpha1.ToolChoiceAuto - 5, // 5: tim.api.thread_context.v1alpha1.ToolChoice.required:type_name -> tim.api.thread_context.v1alpha1.ToolChoiceRequired - 6, // 6: tim.api.thread_context.v1alpha1.ToolChoice.tool:type_name -> tim.api.thread_context.v1alpha1.ToolChoiceTool - 7, // 7: tim.api.thread_context.v1alpha1.ToolChoice.none:type_name -> tim.api.thread_context.v1alpha1.ToolChoiceNone - 10, // 8: tim.api.thread_context.v1alpha1.ToolInputSchema.PropertiesEntry.value:type_name -> google.protobuf.Any +var file_tim_int_thread_context_v1alpha1_thread_context_types_proto_depIdxs = []int32{ + 9, // 0: tim.int.thread_context.v1alpha1.ThreadContext.messages:type_name -> tim.api.thread.v1alpha1.LlmMessage + 3, // 1: tim.int.thread_context.v1alpha1.ThreadContext.tool_choice:type_name -> tim.int.thread_context.v1alpha1.ToolChoice + 2, // 2: tim.int.thread_context.v1alpha1.Tool.input_schema:type_name -> tim.int.thread_context.v1alpha1.ToolInputSchema + 8, // 3: tim.int.thread_context.v1alpha1.ToolInputSchema.properties:type_name -> tim.int.thread_context.v1alpha1.ToolInputSchema.PropertiesEntry + 4, // 4: tim.int.thread_context.v1alpha1.ToolChoice.auto:type_name -> tim.int.thread_context.v1alpha1.ToolChoiceAuto + 5, // 5: tim.int.thread_context.v1alpha1.ToolChoice.required:type_name -> tim.int.thread_context.v1alpha1.ToolChoiceRequired + 6, // 6: tim.int.thread_context.v1alpha1.ToolChoice.tool:type_name -> tim.int.thread_context.v1alpha1.ToolChoiceTool + 7, // 7: tim.int.thread_context.v1alpha1.ToolChoice.none:type_name -> tim.int.thread_context.v1alpha1.ToolChoiceNone + 10, // 8: tim.int.thread_context.v1alpha1.ToolInputSchema.PropertiesEntry.value:type_name -> google.protobuf.Any 9, // [9:9] is the sub-list for method output_type 9, // [9:9] is the sub-list for method input_type 9, // [9:9] is the sub-list for extension type_name @@ -645,12 +645,12 @@ var file_tim_api_thread_context_v1alpha1_thread_context_types_proto_depIdxs = [] 0, // [0:9] is the sub-list for field type_name } -func init() { file_tim_api_thread_context_v1alpha1_thread_context_types_proto_init() } -func file_tim_api_thread_context_v1alpha1_thread_context_types_proto_init() { - if File_tim_api_thread_context_v1alpha1_thread_context_types_proto != nil { +func init() { file_tim_int_thread_context_v1alpha1_thread_context_types_proto_init() } +func file_tim_int_thread_context_v1alpha1_thread_context_types_proto_init() { + if File_tim_int_thread_context_v1alpha1_thread_context_types_proto != nil { return } - file_tim_api_thread_context_v1alpha1_thread_context_types_proto_msgTypes[3].OneofWrappers = []any{ + file_tim_int_thread_context_v1alpha1_thread_context_types_proto_msgTypes[3].OneofWrappers = []any{ (*ToolChoice_Auto)(nil), (*ToolChoice_Required)(nil), (*ToolChoice_Tool)(nil), @@ -660,17 +660,17 @@ func file_tim_api_thread_context_v1alpha1_thread_context_types_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_tim_api_thread_context_v1alpha1_thread_context_types_proto_rawDesc), len(file_tim_api_thread_context_v1alpha1_thread_context_types_proto_rawDesc)), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_tim_int_thread_context_v1alpha1_thread_context_types_proto_rawDesc), len(file_tim_int_thread_context_v1alpha1_thread_context_types_proto_rawDesc)), NumEnums: 0, NumMessages: 9, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_tim_api_thread_context_v1alpha1_thread_context_types_proto_goTypes, - DependencyIndexes: file_tim_api_thread_context_v1alpha1_thread_context_types_proto_depIdxs, - MessageInfos: file_tim_api_thread_context_v1alpha1_thread_context_types_proto_msgTypes, + GoTypes: file_tim_int_thread_context_v1alpha1_thread_context_types_proto_goTypes, + DependencyIndexes: file_tim_int_thread_context_v1alpha1_thread_context_types_proto_depIdxs, + MessageInfos: file_tim_int_thread_context_v1alpha1_thread_context_types_proto_msgTypes, }.Build() - File_tim_api_thread_context_v1alpha1_thread_context_types_proto = out.File - file_tim_api_thread_context_v1alpha1_thread_context_types_proto_goTypes = nil - file_tim_api_thread_context_v1alpha1_thread_context_types_proto_depIdxs = nil + File_tim_int_thread_context_v1alpha1_thread_context_types_proto = out.File + file_tim_int_thread_context_v1alpha1_thread_context_types_proto_goTypes = nil + file_tim_int_thread_context_v1alpha1_thread_context_types_proto_depIdxs = nil } diff --git a/tim-proto/gen/tim/api/thread_context/v1alpha1/thread_context_types.swagger.json b/tim-proto/gen/tim/int/thread_context/v1alpha1/thread_context_types.swagger.json similarity index 98% rename from tim-proto/gen/tim/api/thread_context/v1alpha1/thread_context_types.swagger.json rename to tim-proto/gen/tim/int/thread_context/v1alpha1/thread_context_types.swagger.json index 7a39efb0d..04f678e21 100644 --- a/tim-proto/gen/tim/api/thread_context/v1alpha1/thread_context_types.swagger.json +++ b/tim-proto/gen/tim/int/thread_context/v1alpha1/thread_context_types.swagger.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "title": "tim/api/thread_context/v1alpha1/thread_context_types.proto", + "title": "tim/int/thread_context/v1alpha1/thread_context_types.proto", "version": "version not set" }, "consumes": [ diff --git a/tim-proto/gen/tim/api/thread_context/v1alpha1/thread_contextv1alpha1connect/thread_context_service.connect.go b/tim-proto/gen/tim/int/thread_context/v1alpha1/thread_contextv1alpha1connect/thread_context_service.connect.go similarity index 86% rename from tim-proto/gen/tim/api/thread_context/v1alpha1/thread_contextv1alpha1connect/thread_context_service.connect.go rename to tim-proto/gen/tim/int/thread_context/v1alpha1/thread_contextv1alpha1connect/thread_context_service.connect.go index 77b57884b..c44434db8 100644 --- a/tim-proto/gen/tim/api/thread_context/v1alpha1/thread_contextv1alpha1connect/thread_context_service.connect.go +++ b/tim-proto/gen/tim/int/thread_context/v1alpha1/thread_contextv1alpha1connect/thread_context_service.connect.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-connect-go. DO NOT EDIT. // -// Source: tim/api/thread_context/v1alpha1/thread_context_service.proto +// Source: tim/int/thread_context/v1alpha1/thread_context_service.proto package thread_contextv1alpha1connect @@ -8,7 +8,7 @@ import ( connect "connectrpc.com/connect" context "context" errors "errors" - v1alpha1 "github.com/Greybox-Labs/tim/tim-proto/gen/tim/api/thread_context/v1alpha1" + v1alpha1 "github.com/Greybox-Labs/tim/tim-proto/gen/tim/int/thread_context/v1alpha1" http "net/http" strings "strings" ) @@ -22,7 +22,7 @@ const _ = connect.IsAtLeastVersion1_13_0 const ( // ThreadContextServiceName is the fully-qualified name of the ThreadContextService service. - ThreadContextServiceName = "tim.api.thread_context.v1alpha1.ThreadContextService" + ThreadContextServiceName = "tim.int.thread_context.v1alpha1.ThreadContextService" ) // These constants are the fully-qualified names of the RPCs defined in this package. They're @@ -35,18 +35,18 @@ const ( const ( // ThreadContextServiceGetThreadContextProcedure is the fully-qualified name of the // ThreadContextService's GetThreadContext RPC. - ThreadContextServiceGetThreadContextProcedure = "/tim.api.thread_context.v1alpha1.ThreadContextService/GetThreadContext" + ThreadContextServiceGetThreadContextProcedure = "/tim.int.thread_context.v1alpha1.ThreadContextService/GetThreadContext" ) // ThreadContextServiceClient is a client for the -// tim.api.thread_context.v1alpha1.ThreadContextService service. +// tim.int.thread_context.v1alpha1.ThreadContextService service. type ThreadContextServiceClient interface { // Get a thread's active context GetThreadContext(context.Context, *connect.Request[v1alpha1.GetThreadContextRequest]) (*connect.Response[v1alpha1.ThreadContext], error) } // NewThreadContextServiceClient constructs a client for the -// tim.api.thread_context.v1alpha1.ThreadContextService service. By default, it uses the Connect +// tim.int.thread_context.v1alpha1.ThreadContextService service. By default, it uses the Connect // protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed // requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or // connect.WithGRPCWeb() options. @@ -55,7 +55,7 @@ type ThreadContextServiceClient interface { // http://api.acme.com or https://acme.com/grpc). func NewThreadContextServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) ThreadContextServiceClient { baseURL = strings.TrimRight(baseURL, "/") - threadContextServiceMethods := v1alpha1.File_tim_api_thread_context_v1alpha1_thread_context_service_proto.Services().ByName("ThreadContextService").Methods() + threadContextServiceMethods := v1alpha1.File_tim_int_thread_context_v1alpha1_thread_context_service_proto.Services().ByName("ThreadContextService").Methods() return &threadContextServiceClient{ getThreadContext: connect.NewClient[v1alpha1.GetThreadContextRequest, v1alpha1.ThreadContext]( httpClient, @@ -71,13 +71,13 @@ type threadContextServiceClient struct { getThreadContext *connect.Client[v1alpha1.GetThreadContextRequest, v1alpha1.ThreadContext] } -// GetThreadContext calls tim.api.thread_context.v1alpha1.ThreadContextService.GetThreadContext. +// GetThreadContext calls tim.int.thread_context.v1alpha1.ThreadContextService.GetThreadContext. func (c *threadContextServiceClient) GetThreadContext(ctx context.Context, req *connect.Request[v1alpha1.GetThreadContextRequest]) (*connect.Response[v1alpha1.ThreadContext], error) { return c.getThreadContext.CallUnary(ctx, req) } // ThreadContextServiceHandler is an implementation of the -// tim.api.thread_context.v1alpha1.ThreadContextService service. +// tim.int.thread_context.v1alpha1.ThreadContextService service. type ThreadContextServiceHandler interface { // Get a thread's active context GetThreadContext(context.Context, *connect.Request[v1alpha1.GetThreadContextRequest]) (*connect.Response[v1alpha1.ThreadContext], error) @@ -89,14 +89,14 @@ type ThreadContextServiceHandler interface { // By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf // and JSON codecs. They also support gzip compression. func NewThreadContextServiceHandler(svc ThreadContextServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { - threadContextServiceMethods := v1alpha1.File_tim_api_thread_context_v1alpha1_thread_context_service_proto.Services().ByName("ThreadContextService").Methods() + threadContextServiceMethods := v1alpha1.File_tim_int_thread_context_v1alpha1_thread_context_service_proto.Services().ByName("ThreadContextService").Methods() threadContextServiceGetThreadContextHandler := connect.NewUnaryHandler( ThreadContextServiceGetThreadContextProcedure, svc.GetThreadContext, connect.WithSchema(threadContextServiceMethods.ByName("GetThreadContext")), connect.WithHandlerOptions(opts...), ) - return "/tim.api.thread_context.v1alpha1.ThreadContextService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + return "/tim.int.thread_context.v1alpha1.ThreadContextService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { switch r.URL.Path { case ThreadContextServiceGetThreadContextProcedure: threadContextServiceGetThreadContextHandler.ServeHTTP(w, r) @@ -110,5 +110,5 @@ func NewThreadContextServiceHandler(svc ThreadContextServiceHandler, opts ...con type UnimplementedThreadContextServiceHandler struct{} func (UnimplementedThreadContextServiceHandler) GetThreadContext(context.Context, *connect.Request[v1alpha1.GetThreadContextRequest]) (*connect.Response[v1alpha1.ThreadContext], error) { - return nil, connect.NewError(connect.CodeUnimplemented, errors.New("tim.api.thread_context.v1alpha1.ThreadContextService.GetThreadContext is not implemented")) + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("tim.int.thread_context.v1alpha1.ThreadContextService.GetThreadContext is not implemented")) } diff --git a/tim-proto/gen/tim/api/tool_execution/v1alpha1/tool_execution_service.pb.go b/tim-proto/gen/tim/int/tool_execution/v1alpha1/tool_execution_service.pb.go similarity index 63% rename from tim-proto/gen/tim/api/tool_execution/v1alpha1/tool_execution_service.pb.go rename to tim-proto/gen/tim/int/tool_execution/v1alpha1/tool_execution_service.pb.go index 85e561fe4..3092e991c 100644 --- a/tim-proto/gen/tim/api/tool_execution/v1alpha1/tool_execution_service.pb.go +++ b/tim-proto/gen/tim/int/tool_execution/v1alpha1/tool_execution_service.pb.go @@ -2,7 +2,7 @@ // versions: // protoc-gen-go v1.36.9 // protoc (unknown) -// source: tim/api/tool_execution/v1alpha1/tool_execution_service.proto +// source: tim/int/tool_execution/v1alpha1/tool_execution_service.proto package tool_executionv1alpha1 @@ -36,7 +36,7 @@ type GetToolCallRequest struct { func (x *GetToolCallRequest) Reset() { *x = GetToolCallRequest{} - mi := &file_tim_api_tool_execution_v1alpha1_tool_execution_service_proto_msgTypes[0] + mi := &file_tim_int_tool_execution_v1alpha1_tool_execution_service_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -48,7 +48,7 @@ func (x *GetToolCallRequest) String() string { func (*GetToolCallRequest) ProtoMessage() {} func (x *GetToolCallRequest) ProtoReflect() protoreflect.Message { - mi := &file_tim_api_tool_execution_v1alpha1_tool_execution_service_proto_msgTypes[0] + mi := &file_tim_int_tool_execution_v1alpha1_tool_execution_service_proto_msgTypes[0] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -61,7 +61,7 @@ func (x *GetToolCallRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetToolCallRequest.ProtoReflect.Descriptor instead. func (*GetToolCallRequest) Descriptor() ([]byte, []int) { - return file_tim_api_tool_execution_v1alpha1_tool_execution_service_proto_rawDescGZIP(), []int{0} + return file_tim_int_tool_execution_v1alpha1_tool_execution_service_proto_rawDescGZIP(), []int{0} } func (x *GetToolCallRequest) GetPath() string { @@ -84,7 +84,7 @@ type SubmitToolResultRequest struct { func (x *SubmitToolResultRequest) Reset() { *x = SubmitToolResultRequest{} - mi := &file_tim_api_tool_execution_v1alpha1_tool_execution_service_proto_msgTypes[1] + mi := &file_tim_int_tool_execution_v1alpha1_tool_execution_service_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -96,7 +96,7 @@ func (x *SubmitToolResultRequest) String() string { func (*SubmitToolResultRequest) ProtoMessage() {} func (x *SubmitToolResultRequest) ProtoReflect() protoreflect.Message { - mi := &file_tim_api_tool_execution_v1alpha1_tool_execution_service_proto_msgTypes[1] + mi := &file_tim_int_tool_execution_v1alpha1_tool_execution_service_proto_msgTypes[1] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -109,7 +109,7 @@ func (x *SubmitToolResultRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SubmitToolResultRequest.ProtoReflect.Descriptor instead. func (*SubmitToolResultRequest) Descriptor() ([]byte, []int) { - return file_tim_api_tool_execution_v1alpha1_tool_execution_service_proto_rawDescGZIP(), []int{1} + return file_tim_int_tool_execution_v1alpha1_tool_execution_service_proto_rawDescGZIP(), []int{1} } func (x *SubmitToolResultRequest) GetPath() string { @@ -141,7 +141,7 @@ type SubmitToolResultResponse struct { func (x *SubmitToolResultResponse) Reset() { *x = SubmitToolResultResponse{} - mi := &file_tim_api_tool_execution_v1alpha1_tool_execution_service_proto_msgTypes[2] + mi := &file_tim_int_tool_execution_v1alpha1_tool_execution_service_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -153,7 +153,7 @@ func (x *SubmitToolResultResponse) String() string { func (*SubmitToolResultResponse) ProtoMessage() {} func (x *SubmitToolResultResponse) ProtoReflect() protoreflect.Message { - mi := &file_tim_api_tool_execution_v1alpha1_tool_execution_service_proto_msgTypes[2] + mi := &file_tim_int_tool_execution_v1alpha1_tool_execution_service_proto_msgTypes[2] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -166,7 +166,7 @@ func (x *SubmitToolResultResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use SubmitToolResultResponse.ProtoReflect.Descriptor instead. func (*SubmitToolResultResponse) Descriptor() ([]byte, []int) { - return file_tim_api_tool_execution_v1alpha1_tool_execution_service_proto_rawDescGZIP(), []int{2} + return file_tim_int_tool_execution_v1alpha1_tool_execution_service_proto_rawDescGZIP(), []int{2} } func (x *SubmitToolResultResponse) GetMessage() string { @@ -190,11 +190,11 @@ func (x *SubmitToolResultResponse) GetToolCallId() string { return "" } -var File_tim_api_tool_execution_v1alpha1_tool_execution_service_proto protoreflect.FileDescriptor +var File_tim_int_tool_execution_v1alpha1_tool_execution_service_proto protoreflect.FileDescriptor -const file_tim_api_tool_execution_v1alpha1_tool_execution_service_proto_rawDesc = "" + +const file_tim_int_tool_execution_v1alpha1_tool_execution_service_proto_rawDesc = "" + "\n" + - " tim.api.tool.v1alpha1.ToolResult - 0, // 1: tim.api.tool_execution.v1alpha1.ToolExecutionService.GetToolCall:input_type -> tim.api.tool_execution.v1alpha1.GetToolCallRequest - 1, // 2: tim.api.tool_execution.v1alpha1.ToolExecutionService.SubmitToolResult:input_type -> tim.api.tool_execution.v1alpha1.SubmitToolResultRequest - 4, // 3: tim.api.tool_execution.v1alpha1.ToolExecutionService.GetToolCall:output_type -> tim.api.tool_execution.v1alpha1.ToolCall - 2, // 4: tim.api.tool_execution.v1alpha1.ToolExecutionService.SubmitToolResult:output_type -> tim.api.tool_execution.v1alpha1.SubmitToolResultResponse +var file_tim_int_tool_execution_v1alpha1_tool_execution_service_proto_depIdxs = []int32{ + 3, // 0: tim.int.tool_execution.v1alpha1.SubmitToolResultRequest.tool_result:type_name -> tim.api.tool.v1alpha1.ToolResult + 0, // 1: tim.int.tool_execution.v1alpha1.ToolExecutionService.GetToolCall:input_type -> tim.int.tool_execution.v1alpha1.GetToolCallRequest + 1, // 2: tim.int.tool_execution.v1alpha1.ToolExecutionService.SubmitToolResult:input_type -> tim.int.tool_execution.v1alpha1.SubmitToolResultRequest + 4, // 3: tim.int.tool_execution.v1alpha1.ToolExecutionService.GetToolCall:output_type -> tim.int.tool_execution.v1alpha1.ToolCall + 2, // 4: tim.int.tool_execution.v1alpha1.ToolExecutionService.SubmitToolResult:output_type -> tim.int.tool_execution.v1alpha1.SubmitToolResultResponse 3, // [3:5] is the sub-list for method output_type 1, // [1:3] is the sub-list for method input_type 1, // [1:1] is the sub-list for extension type_name @@ -244,27 +244,27 @@ var file_tim_api_tool_execution_v1alpha1_tool_execution_service_proto_depIdxs = 0, // [0:1] is the sub-list for field type_name } -func init() { file_tim_api_tool_execution_v1alpha1_tool_execution_service_proto_init() } -func file_tim_api_tool_execution_v1alpha1_tool_execution_service_proto_init() { - if File_tim_api_tool_execution_v1alpha1_tool_execution_service_proto != nil { +func init() { file_tim_int_tool_execution_v1alpha1_tool_execution_service_proto_init() } +func file_tim_int_tool_execution_v1alpha1_tool_execution_service_proto_init() { + if File_tim_int_tool_execution_v1alpha1_tool_execution_service_proto != nil { return } - file_tim_api_tool_execution_v1alpha1_tool_execution_types_proto_init() + file_tim_int_tool_execution_v1alpha1_tool_execution_types_proto_init() type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_tim_api_tool_execution_v1alpha1_tool_execution_service_proto_rawDesc), len(file_tim_api_tool_execution_v1alpha1_tool_execution_service_proto_rawDesc)), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_tim_int_tool_execution_v1alpha1_tool_execution_service_proto_rawDesc), len(file_tim_int_tool_execution_v1alpha1_tool_execution_service_proto_rawDesc)), NumEnums: 0, NumMessages: 3, NumExtensions: 0, NumServices: 1, }, - GoTypes: file_tim_api_tool_execution_v1alpha1_tool_execution_service_proto_goTypes, - DependencyIndexes: file_tim_api_tool_execution_v1alpha1_tool_execution_service_proto_depIdxs, - MessageInfos: file_tim_api_tool_execution_v1alpha1_tool_execution_service_proto_msgTypes, + GoTypes: file_tim_int_tool_execution_v1alpha1_tool_execution_service_proto_goTypes, + DependencyIndexes: file_tim_int_tool_execution_v1alpha1_tool_execution_service_proto_depIdxs, + MessageInfos: file_tim_int_tool_execution_v1alpha1_tool_execution_service_proto_msgTypes, }.Build() - File_tim_api_tool_execution_v1alpha1_tool_execution_service_proto = out.File - file_tim_api_tool_execution_v1alpha1_tool_execution_service_proto_goTypes = nil - file_tim_api_tool_execution_v1alpha1_tool_execution_service_proto_depIdxs = nil + File_tim_int_tool_execution_v1alpha1_tool_execution_service_proto = out.File + file_tim_int_tool_execution_v1alpha1_tool_execution_service_proto_goTypes = nil + file_tim_int_tool_execution_v1alpha1_tool_execution_service_proto_depIdxs = nil } diff --git a/tim-proto/gen/tim/api/tool_execution/v1alpha1/tool_execution_service.swagger.json b/tim-proto/gen/tim/int/tool_execution/v1alpha1/tool_execution_service.swagger.json similarity index 77% rename from tim-proto/gen/tim/api/tool_execution/v1alpha1/tool_execution_service.swagger.json rename to tim-proto/gen/tim/int/tool_execution/v1alpha1/tool_execution_service.swagger.json index 85fbe5050..6e8c8b5b1 100644 --- a/tim-proto/gen/tim/api/tool_execution/v1alpha1/tool_execution_service.swagger.json +++ b/tim-proto/gen/tim/int/tool_execution/v1alpha1/tool_execution_service.swagger.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "title": "tim/api/tool_execution/v1alpha1/tool_execution_service.proto", + "title": "tim/int/tool_execution/v1alpha1/tool_execution_service.proto", "version": "version not set" }, "tags": [ @@ -15,106 +15,8 @@ "produces": [ "application/json" ], - "paths": { - "/v1alpha1/{path}": { - "get": { - "summary": "Get a specific tool call by its ID", - "operationId": "ToolExecutionService_GetToolCall", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/apitool_executionv1alpha1ToolCall" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "path", - "description": "The resource path of the tool call", - "in": "path", - "required": true, - "type": "string", - "pattern": "orgs/[^/]+/users/[^/]+/threads/[^/]+/toolCalls/[^/]+" - } - ], - "tags": [ - "ToolExecutionService" - ] - } - }, - "/v1alpha1/{path}:submit": { - "post": { - "summary": "Submit a tool execution result", - "operationId": "ToolExecutionService_SubmitToolResult", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1alpha1SubmitToolResultResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "path", - "description": "The resource path of the tool call", - "in": "path", - "required": true, - "type": "string", - "pattern": "orgs/[^/]+/users/[^/]+/threads/[^/]+/toolCalls/[^/]+" - }, - { - "name": "toolResult", - "description": "The tool result to submit", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1alpha1ToolResult" - } - } - ], - "tags": [ - "ToolExecutionService" - ] - } - } - }, + "paths": {}, "definitions": { - "apitool_executionv1alpha1ToolCall": { - "type": "object", - "properties": { - "path": { - "type": "string", - "title": "The resource path of the tool call\nFormat: orgs/{org}/users/{user}/threads/{thread}/toolCalls/{tool_call_id}", - "readOnly": true - }, - "toolCall": { - "$ref": "#/definitions/apitoolv1alpha1ToolCall", - "title": "The tool call details (includes the tool_call.id, name, and input)", - "readOnly": true - }, - "createTime": { - "type": "string", - "format": "date-time", - "title": "When the tool call was created", - "readOnly": true - } - }, - "title": "ToolCall represents a tool call that needs to be executed" - }, "apitoolv1alpha1ToolCall": { "type": "object", "properties": { @@ -137,6 +39,28 @@ }, "description": "ToolCall represents a call to a specific tool with its corresponding input parameters." }, + "inttool_executionv1alpha1ToolCall": { + "type": "object", + "properties": { + "path": { + "type": "string", + "title": "The resource path of the tool call\nFormat: orgs/{org}/users/{user}/threads/{thread}/toolCalls/{tool_call_id}", + "readOnly": true + }, + "toolCall": { + "$ref": "#/definitions/apitoolv1alpha1ToolCall", + "title": "The tool call details (includes the tool_call.id, name, and input)", + "readOnly": true + }, + "createTime": { + "type": "string", + "format": "date-time", + "title": "When the tool call was created", + "readOnly": true + } + }, + "title": "ToolCall represents a tool call that needs to be executed" + }, "protobufAny": { "type": "object", "properties": { diff --git a/tim-proto/gen/tim/api/tool_execution/v1alpha1/tool_execution_types.pb.go b/tim-proto/gen/tim/int/tool_execution/v1alpha1/tool_execution_types.pb.go similarity index 64% rename from tim-proto/gen/tim/api/tool_execution/v1alpha1/tool_execution_types.pb.go rename to tim-proto/gen/tim/int/tool_execution/v1alpha1/tool_execution_types.pb.go index b7fe77f8b..547759bf6 100644 --- a/tim-proto/gen/tim/api/tool_execution/v1alpha1/tool_execution_types.pb.go +++ b/tim-proto/gen/tim/int/tool_execution/v1alpha1/tool_execution_types.pb.go @@ -2,7 +2,7 @@ // versions: // protoc-gen-go v1.36.9 // protoc (unknown) -// source: tim/api/tool_execution/v1alpha1/tool_execution_types.proto +// source: tim/int/tool_execution/v1alpha1/tool_execution_types.proto package tool_executionv1alpha1 @@ -41,7 +41,7 @@ type ToolCall struct { func (x *ToolCall) Reset() { *x = ToolCall{} - mi := &file_tim_api_tool_execution_v1alpha1_tool_execution_types_proto_msgTypes[0] + mi := &file_tim_int_tool_execution_v1alpha1_tool_execution_types_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -53,7 +53,7 @@ func (x *ToolCall) String() string { func (*ToolCall) ProtoMessage() {} func (x *ToolCall) ProtoReflect() protoreflect.Message { - mi := &file_tim_api_tool_execution_v1alpha1_tool_execution_types_proto_msgTypes[0] + mi := &file_tim_int_tool_execution_v1alpha1_tool_execution_types_proto_msgTypes[0] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -66,7 +66,7 @@ func (x *ToolCall) ProtoReflect() protoreflect.Message { // Deprecated: Use ToolCall.ProtoReflect.Descriptor instead. func (*ToolCall) Descriptor() ([]byte, []int) { - return file_tim_api_tool_execution_v1alpha1_tool_execution_types_proto_rawDescGZIP(), []int{0} + return file_tim_int_tool_execution_v1alpha1_tool_execution_types_proto_rawDescGZIP(), []int{0} } func (x *ToolCall) GetPath() string { @@ -90,41 +90,41 @@ func (x *ToolCall) GetCreateTime() *timestamppb.Timestamp { return nil } -var File_tim_api_tool_execution_v1alpha1_tool_execution_types_proto protoreflect.FileDescriptor +var File_tim_int_tool_execution_v1alpha1_tool_execution_types_proto protoreflect.FileDescriptor -const file_tim_api_tool_execution_v1alpha1_tool_execution_types_proto_rawDesc = "" + +const file_tim_int_tool_execution_v1alpha1_tool_execution_types_proto_rawDesc = "" + "\n" + - ":tim/api/tool_execution/v1alpha1/tool_execution_types.proto\x12\x1ftim.api.tool_execution.v1alpha1\x1a\x1bbuf/validate/validate.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a&tim/api/tool/v1alpha1/tool_types.proto\"\xa9\x02\n" + + ":tim/int/tool_execution/v1alpha1/tool_execution_types.proto\x12\x1ftim.int.tool_execution.v1alpha1\x1a\x1bbuf/validate/validate.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a&tim/api/tool/v1alpha1/tool_types.proto\"\xa9\x02\n" + "\bToolCall\x12\x1d\n" + "\x04path\x18\x01 \x01(\tB\t\xe0A\x03\xbaH\x03\xd8\x01\x01R\x04path\x12A\n" + "\ttool_call\x18\x02 \x01(\v2\x1f.tim.api.tool.v1alpha1.ToolCallB\x03\xe0A\x03R\btoolCall\x12@\n" + "\vcreate_time\x18\x03 \x01(\v2\x1a.google.protobuf.TimestampB\x03\xe0A\x03R\n" + "createTime:y\xeaAv\n" + "\x1dtim.settlerlabs.com/tool-call\x12>orgs/{org}/users/{user}/threads/{thread}/toolCalls/{tool-call}*\n" + - "tool-calls2\ttool-callB\xbb\x02\n" + - "#com.tim.api.tool_execution.v1alpha1B\x17ToolExecutionTypesProtoP\x01Z`github.com/Greybox-Labs/tim/tim-proto/gen/tim/api/tool_execution/v1alpha1;tool_executionv1alpha1\xa2\x02\x03TAT\xaa\x02\x1eTim.Api.ToolExecution.V1alpha1\xca\x02\x1eTim\\Api\\ToolExecution\\V1alpha1\xe2\x02*Tim\\Api\\ToolExecution\\V1alpha1\\GPBMetadata\xea\x02!Tim::Api::ToolExecution::V1alpha1b\x06proto3" + "tool-calls2\ttool-callB\xbd\x02\n" + + "#com.tim.int.tool_execution.v1alpha1B\x17ToolExecutionTypesProtoP\x01Z`github.com/Greybox-Labs/tim/tim-proto/gen/tim/int/tool_execution/v1alpha1;tool_executionv1alpha1\xa2\x02\x03TIT\xaa\x02\x1eTim.Int.ToolExecution.V1alpha1\xca\x02\x1fTim\\Int_\\ToolExecution\\V1alpha1\xe2\x02+Tim\\Int_\\ToolExecution\\V1alpha1\\GPBMetadata\xea\x02!Tim::Int::ToolExecution::V1alpha1b\x06proto3" var ( - file_tim_api_tool_execution_v1alpha1_tool_execution_types_proto_rawDescOnce sync.Once - file_tim_api_tool_execution_v1alpha1_tool_execution_types_proto_rawDescData []byte + file_tim_int_tool_execution_v1alpha1_tool_execution_types_proto_rawDescOnce sync.Once + file_tim_int_tool_execution_v1alpha1_tool_execution_types_proto_rawDescData []byte ) -func file_tim_api_tool_execution_v1alpha1_tool_execution_types_proto_rawDescGZIP() []byte { - file_tim_api_tool_execution_v1alpha1_tool_execution_types_proto_rawDescOnce.Do(func() { - file_tim_api_tool_execution_v1alpha1_tool_execution_types_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_tim_api_tool_execution_v1alpha1_tool_execution_types_proto_rawDesc), len(file_tim_api_tool_execution_v1alpha1_tool_execution_types_proto_rawDesc))) +func file_tim_int_tool_execution_v1alpha1_tool_execution_types_proto_rawDescGZIP() []byte { + file_tim_int_tool_execution_v1alpha1_tool_execution_types_proto_rawDescOnce.Do(func() { + file_tim_int_tool_execution_v1alpha1_tool_execution_types_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_tim_int_tool_execution_v1alpha1_tool_execution_types_proto_rawDesc), len(file_tim_int_tool_execution_v1alpha1_tool_execution_types_proto_rawDesc))) }) - return file_tim_api_tool_execution_v1alpha1_tool_execution_types_proto_rawDescData + return file_tim_int_tool_execution_v1alpha1_tool_execution_types_proto_rawDescData } -var file_tim_api_tool_execution_v1alpha1_tool_execution_types_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_tim_api_tool_execution_v1alpha1_tool_execution_types_proto_goTypes = []any{ - (*ToolCall)(nil), // 0: tim.api.tool_execution.v1alpha1.ToolCall +var file_tim_int_tool_execution_v1alpha1_tool_execution_types_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_tim_int_tool_execution_v1alpha1_tool_execution_types_proto_goTypes = []any{ + (*ToolCall)(nil), // 0: tim.int.tool_execution.v1alpha1.ToolCall (*v1alpha1.ToolCall)(nil), // 1: tim.api.tool.v1alpha1.ToolCall (*timestamppb.Timestamp)(nil), // 2: google.protobuf.Timestamp } -var file_tim_api_tool_execution_v1alpha1_tool_execution_types_proto_depIdxs = []int32{ - 1, // 0: tim.api.tool_execution.v1alpha1.ToolCall.tool_call:type_name -> tim.api.tool.v1alpha1.ToolCall - 2, // 1: tim.api.tool_execution.v1alpha1.ToolCall.create_time:type_name -> google.protobuf.Timestamp +var file_tim_int_tool_execution_v1alpha1_tool_execution_types_proto_depIdxs = []int32{ + 1, // 0: tim.int.tool_execution.v1alpha1.ToolCall.tool_call:type_name -> tim.api.tool.v1alpha1.ToolCall + 2, // 1: tim.int.tool_execution.v1alpha1.ToolCall.create_time:type_name -> google.protobuf.Timestamp 2, // [2:2] is the sub-list for method output_type 2, // [2:2] is the sub-list for method input_type 2, // [2:2] is the sub-list for extension type_name @@ -132,26 +132,26 @@ var file_tim_api_tool_execution_v1alpha1_tool_execution_types_proto_depIdxs = [] 0, // [0:2] is the sub-list for field type_name } -func init() { file_tim_api_tool_execution_v1alpha1_tool_execution_types_proto_init() } -func file_tim_api_tool_execution_v1alpha1_tool_execution_types_proto_init() { - if File_tim_api_tool_execution_v1alpha1_tool_execution_types_proto != nil { +func init() { file_tim_int_tool_execution_v1alpha1_tool_execution_types_proto_init() } +func file_tim_int_tool_execution_v1alpha1_tool_execution_types_proto_init() { + if File_tim_int_tool_execution_v1alpha1_tool_execution_types_proto != nil { return } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_tim_api_tool_execution_v1alpha1_tool_execution_types_proto_rawDesc), len(file_tim_api_tool_execution_v1alpha1_tool_execution_types_proto_rawDesc)), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_tim_int_tool_execution_v1alpha1_tool_execution_types_proto_rawDesc), len(file_tim_int_tool_execution_v1alpha1_tool_execution_types_proto_rawDesc)), NumEnums: 0, NumMessages: 1, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_tim_api_tool_execution_v1alpha1_tool_execution_types_proto_goTypes, - DependencyIndexes: file_tim_api_tool_execution_v1alpha1_tool_execution_types_proto_depIdxs, - MessageInfos: file_tim_api_tool_execution_v1alpha1_tool_execution_types_proto_msgTypes, + GoTypes: file_tim_int_tool_execution_v1alpha1_tool_execution_types_proto_goTypes, + DependencyIndexes: file_tim_int_tool_execution_v1alpha1_tool_execution_types_proto_depIdxs, + MessageInfos: file_tim_int_tool_execution_v1alpha1_tool_execution_types_proto_msgTypes, }.Build() - File_tim_api_tool_execution_v1alpha1_tool_execution_types_proto = out.File - file_tim_api_tool_execution_v1alpha1_tool_execution_types_proto_goTypes = nil - file_tim_api_tool_execution_v1alpha1_tool_execution_types_proto_depIdxs = nil + File_tim_int_tool_execution_v1alpha1_tool_execution_types_proto = out.File + file_tim_int_tool_execution_v1alpha1_tool_execution_types_proto_goTypes = nil + file_tim_int_tool_execution_v1alpha1_tool_execution_types_proto_depIdxs = nil } diff --git a/tim-proto/gen/tim/api/tool_execution/v1alpha1/tool_execution_types.swagger.json b/tim-proto/gen/tim/int/tool_execution/v1alpha1/tool_execution_types.swagger.json similarity index 98% rename from tim-proto/gen/tim/api/tool_execution/v1alpha1/tool_execution_types.swagger.json rename to tim-proto/gen/tim/int/tool_execution/v1alpha1/tool_execution_types.swagger.json index 238a49706..5f90c5560 100644 --- a/tim-proto/gen/tim/api/tool_execution/v1alpha1/tool_execution_types.swagger.json +++ b/tim-proto/gen/tim/int/tool_execution/v1alpha1/tool_execution_types.swagger.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "title": "tim/api/tool_execution/v1alpha1/tool_execution_types.proto", + "title": "tim/int/tool_execution/v1alpha1/tool_execution_types.proto", "version": "version not set" }, "consumes": [ diff --git a/tim-proto/gen/tim/api/tool_execution/v1alpha1/tool_executionv1alpha1connect/tool_execution_service.connect.go b/tim-proto/gen/tim/int/tool_execution/v1alpha1/tool_executionv1alpha1connect/tool_execution_service.connect.go similarity index 87% rename from tim-proto/gen/tim/api/tool_execution/v1alpha1/tool_executionv1alpha1connect/tool_execution_service.connect.go rename to tim-proto/gen/tim/int/tool_execution/v1alpha1/tool_executionv1alpha1connect/tool_execution_service.connect.go index a1bf272df..2d051aa80 100644 --- a/tim-proto/gen/tim/api/tool_execution/v1alpha1/tool_executionv1alpha1connect/tool_execution_service.connect.go +++ b/tim-proto/gen/tim/int/tool_execution/v1alpha1/tool_executionv1alpha1connect/tool_execution_service.connect.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-connect-go. DO NOT EDIT. // -// Source: tim/api/tool_execution/v1alpha1/tool_execution_service.proto +// Source: tim/int/tool_execution/v1alpha1/tool_execution_service.proto package tool_executionv1alpha1connect @@ -8,7 +8,7 @@ import ( connect "connectrpc.com/connect" context "context" errors "errors" - v1alpha1 "github.com/Greybox-Labs/tim/tim-proto/gen/tim/api/tool_execution/v1alpha1" + v1alpha1 "github.com/Greybox-Labs/tim/tim-proto/gen/tim/int/tool_execution/v1alpha1" http "net/http" strings "strings" ) @@ -22,7 +22,7 @@ const _ = connect.IsAtLeastVersion1_13_0 const ( // ToolExecutionServiceName is the fully-qualified name of the ToolExecutionService service. - ToolExecutionServiceName = "tim.api.tool_execution.v1alpha1.ToolExecutionService" + ToolExecutionServiceName = "tim.int.tool_execution.v1alpha1.ToolExecutionService" ) // These constants are the fully-qualified names of the RPCs defined in this package. They're @@ -35,14 +35,14 @@ const ( const ( // ToolExecutionServiceGetToolCallProcedure is the fully-qualified name of the // ToolExecutionService's GetToolCall RPC. - ToolExecutionServiceGetToolCallProcedure = "/tim.api.tool_execution.v1alpha1.ToolExecutionService/GetToolCall" + ToolExecutionServiceGetToolCallProcedure = "/tim.int.tool_execution.v1alpha1.ToolExecutionService/GetToolCall" // ToolExecutionServiceSubmitToolResultProcedure is the fully-qualified name of the // ToolExecutionService's SubmitToolResult RPC. - ToolExecutionServiceSubmitToolResultProcedure = "/tim.api.tool_execution.v1alpha1.ToolExecutionService/SubmitToolResult" + ToolExecutionServiceSubmitToolResultProcedure = "/tim.int.tool_execution.v1alpha1.ToolExecutionService/SubmitToolResult" ) // ToolExecutionServiceClient is a client for the -// tim.api.tool_execution.v1alpha1.ToolExecutionService service. +// tim.int.tool_execution.v1alpha1.ToolExecutionService service. type ToolExecutionServiceClient interface { // Get a specific tool call by its ID GetToolCall(context.Context, *connect.Request[v1alpha1.GetToolCallRequest]) (*connect.Response[v1alpha1.ToolCall], error) @@ -51,7 +51,7 @@ type ToolExecutionServiceClient interface { } // NewToolExecutionServiceClient constructs a client for the -// tim.api.tool_execution.v1alpha1.ToolExecutionService service. By default, it uses the Connect +// tim.int.tool_execution.v1alpha1.ToolExecutionService service. By default, it uses the Connect // protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed // requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or // connect.WithGRPCWeb() options. @@ -60,7 +60,7 @@ type ToolExecutionServiceClient interface { // http://api.acme.com or https://acme.com/grpc). func NewToolExecutionServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) ToolExecutionServiceClient { baseURL = strings.TrimRight(baseURL, "/") - toolExecutionServiceMethods := v1alpha1.File_tim_api_tool_execution_v1alpha1_tool_execution_service_proto.Services().ByName("ToolExecutionService").Methods() + toolExecutionServiceMethods := v1alpha1.File_tim_int_tool_execution_v1alpha1_tool_execution_service_proto.Services().ByName("ToolExecutionService").Methods() return &toolExecutionServiceClient{ getToolCall: connect.NewClient[v1alpha1.GetToolCallRequest, v1alpha1.ToolCall]( httpClient, @@ -83,18 +83,18 @@ type toolExecutionServiceClient struct { submitToolResult *connect.Client[v1alpha1.SubmitToolResultRequest, v1alpha1.SubmitToolResultResponse] } -// GetToolCall calls tim.api.tool_execution.v1alpha1.ToolExecutionService.GetToolCall. +// GetToolCall calls tim.int.tool_execution.v1alpha1.ToolExecutionService.GetToolCall. func (c *toolExecutionServiceClient) GetToolCall(ctx context.Context, req *connect.Request[v1alpha1.GetToolCallRequest]) (*connect.Response[v1alpha1.ToolCall], error) { return c.getToolCall.CallUnary(ctx, req) } -// SubmitToolResult calls tim.api.tool_execution.v1alpha1.ToolExecutionService.SubmitToolResult. +// SubmitToolResult calls tim.int.tool_execution.v1alpha1.ToolExecutionService.SubmitToolResult. func (c *toolExecutionServiceClient) SubmitToolResult(ctx context.Context, req *connect.Request[v1alpha1.SubmitToolResultRequest]) (*connect.Response[v1alpha1.SubmitToolResultResponse], error) { return c.submitToolResult.CallUnary(ctx, req) } // ToolExecutionServiceHandler is an implementation of the -// tim.api.tool_execution.v1alpha1.ToolExecutionService service. +// tim.int.tool_execution.v1alpha1.ToolExecutionService service. type ToolExecutionServiceHandler interface { // Get a specific tool call by its ID GetToolCall(context.Context, *connect.Request[v1alpha1.GetToolCallRequest]) (*connect.Response[v1alpha1.ToolCall], error) @@ -108,7 +108,7 @@ type ToolExecutionServiceHandler interface { // By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf // and JSON codecs. They also support gzip compression. func NewToolExecutionServiceHandler(svc ToolExecutionServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { - toolExecutionServiceMethods := v1alpha1.File_tim_api_tool_execution_v1alpha1_tool_execution_service_proto.Services().ByName("ToolExecutionService").Methods() + toolExecutionServiceMethods := v1alpha1.File_tim_int_tool_execution_v1alpha1_tool_execution_service_proto.Services().ByName("ToolExecutionService").Methods() toolExecutionServiceGetToolCallHandler := connect.NewUnaryHandler( ToolExecutionServiceGetToolCallProcedure, svc.GetToolCall, @@ -121,7 +121,7 @@ func NewToolExecutionServiceHandler(svc ToolExecutionServiceHandler, opts ...con connect.WithSchema(toolExecutionServiceMethods.ByName("SubmitToolResult")), connect.WithHandlerOptions(opts...), ) - return "/tim.api.tool_execution.v1alpha1.ToolExecutionService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + return "/tim.int.tool_execution.v1alpha1.ToolExecutionService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { switch r.URL.Path { case ToolExecutionServiceGetToolCallProcedure: toolExecutionServiceGetToolCallHandler.ServeHTTP(w, r) @@ -137,9 +137,9 @@ func NewToolExecutionServiceHandler(svc ToolExecutionServiceHandler, opts ...con type UnimplementedToolExecutionServiceHandler struct{} func (UnimplementedToolExecutionServiceHandler) GetToolCall(context.Context, *connect.Request[v1alpha1.GetToolCallRequest]) (*connect.Response[v1alpha1.ToolCall], error) { - return nil, connect.NewError(connect.CodeUnimplemented, errors.New("tim.api.tool_execution.v1alpha1.ToolExecutionService.GetToolCall is not implemented")) + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("tim.int.tool_execution.v1alpha1.ToolExecutionService.GetToolCall is not implemented")) } func (UnimplementedToolExecutionServiceHandler) SubmitToolResult(context.Context, *connect.Request[v1alpha1.SubmitToolResultRequest]) (*connect.Response[v1alpha1.SubmitToolResultResponse], error) { - return nil, connect.NewError(connect.CodeUnimplemented, errors.New("tim.api.tool_execution.v1alpha1.ToolExecutionService.SubmitToolResult is not implemented")) + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("tim.int.tool_execution.v1alpha1.ToolExecutionService.SubmitToolResult is not implemented")) } diff --git a/tim-worker/internal/apiclient/client.go b/tim-worker/internal/apiclient/client.go index de59e2ba8..2335a084c 100644 --- a/tim-worker/internal/apiclient/client.go +++ b/tim-worker/internal/apiclient/client.go @@ -9,17 +9,17 @@ import ( "github.com/Greybox-Labs/tim/shared/logger" "github.com/Greybox-Labs/tim/shared/proto" "github.com/Greybox-Labs/tim/shared/tools" - llmresponsev1 "github.com/Greybox-Labs/tim/tim-proto/gen/tim/api/llm_response/v1alpha1" - "github.com/Greybox-Labs/tim/tim-proto/gen/tim/api/llm_response/v1alpha1/llm_responsev1alpha1connect" thread "github.com/Greybox-Labs/tim/tim-proto/gen/tim/api/thread/v1alpha1" "github.com/Greybox-Labs/tim/tim-proto/gen/tim/api/thread/v1alpha1/threadv1alpha1connect" - threadcontextv1 "github.com/Greybox-Labs/tim/tim-proto/gen/tim/api/thread_context/v1alpha1" - "github.com/Greybox-Labs/tim/tim-proto/gen/tim/api/thread_context/v1alpha1/thread_contextv1alpha1connect" todov1 "github.com/Greybox-Labs/tim/tim-proto/gen/tim/api/todo/v1alpha1" "github.com/Greybox-Labs/tim/tim-proto/gen/tim/api/todo/v1alpha1/todov1alpha1connect" toolv1 "github.com/Greybox-Labs/tim/tim-proto/gen/tim/api/tool/v1alpha1" - toolexecutionv1 "github.com/Greybox-Labs/tim/tim-proto/gen/tim/api/tool_execution/v1alpha1" - "github.com/Greybox-Labs/tim/tim-proto/gen/tim/api/tool_execution/v1alpha1/tool_executionv1alpha1connect" + llmresponsev1 "github.com/Greybox-Labs/tim/tim-proto/gen/tim/int/llm_response/v1alpha1" + "github.com/Greybox-Labs/tim/tim-proto/gen/tim/int/llm_response/v1alpha1/llm_responsev1alpha1connect" + threadcontextv1 "github.com/Greybox-Labs/tim/tim-proto/gen/tim/int/thread_context/v1alpha1" + "github.com/Greybox-Labs/tim/tim-proto/gen/tim/int/thread_context/v1alpha1/thread_contextv1alpha1connect" + toolexecutionv1 "github.com/Greybox-Labs/tim/tim-proto/gen/tim/int/tool_execution/v1alpha1" + "github.com/Greybox-Labs/tim/tim-proto/gen/tim/int/tool_execution/v1alpha1/tool_executionv1alpha1connect" ) // Client provides methods to interact with the tim-api internal services diff --git a/tim-worker/internal/apiclient/client_test.go b/tim-worker/internal/apiclient/client_test.go index 8a7fd29d7..056f28191 100644 --- a/tim-worker/internal/apiclient/client_test.go +++ b/tim-worker/internal/apiclient/client_test.go @@ -8,7 +8,7 @@ import ( "testing" "github.com/Greybox-Labs/tim/shared/logger" - llmresponsev1 "github.com/Greybox-Labs/tim/tim-proto/gen/tim/api/llm_response/v1alpha1" + llmresponsev1 "github.com/Greybox-Labs/tim/tim-proto/gen/tim/int/llm_response/v1alpha1" ) func TestNewClient(t *testing.T) { diff --git a/tim-worker/internal/llm_provider/anthropic.go b/tim-worker/internal/llm_provider/anthropic.go index 865e2a476..35865efe0 100644 --- a/tim-worker/internal/llm_provider/anthropic.go +++ b/tim-worker/internal/llm_provider/anthropic.go @@ -5,7 +5,7 @@ import ( "fmt" "github.com/Greybox-Labs/tim/shared/llm" - llmresponse "github.com/Greybox-Labs/tim/tim-proto/gen/tim/api/llm_response/v1alpha1" + llmresponse "github.com/Greybox-Labs/tim/tim-proto/gen/tim/int/llm_response/v1alpha1" "github.com/Greybox-Labs/tim/tim-worker/internal/config" "github.com/anthropics/anthropic-sdk-go" "github.com/anthropics/anthropic-sdk-go/option" diff --git a/tim-worker/internal/llm_provider/anthropic_test.go b/tim-worker/internal/llm_provider/anthropic_test.go index b46cde3a2..105d80f51 100644 --- a/tim-worker/internal/llm_provider/anthropic_test.go +++ b/tim-worker/internal/llm_provider/anthropic_test.go @@ -8,7 +8,7 @@ import ( "testing" "github.com/Greybox-Labs/tim/shared/llm" - llmresponse "github.com/Greybox-Labs/tim/tim-proto/gen/tim/api/llm_response/v1alpha1" + llmresponse "github.com/Greybox-Labs/tim/tim-proto/gen/tim/int/llm_response/v1alpha1" "github.com/Greybox-Labs/tim/tim-worker/internal/config" "github.com/anthropics/anthropic-sdk-go" ) diff --git a/tim-worker/internal/llm_provider/google.go b/tim-worker/internal/llm_provider/google.go index ea01d9ca8..b36c2340f 100644 --- a/tim-worker/internal/llm_provider/google.go +++ b/tim-worker/internal/llm_provider/google.go @@ -10,7 +10,7 @@ import ( "github.com/Greybox-Labs/tim/shared/llm" "github.com/Greybox-Labs/tim/shared/logger" - llmresponse "github.com/Greybox-Labs/tim/tim-proto/gen/tim/api/llm_response/v1alpha1" + llmresponse "github.com/Greybox-Labs/tim/tim-proto/gen/tim/int/llm_response/v1alpha1" "github.com/Greybox-Labs/tim/tim-worker/internal/config" "google.golang.org/genai" ) diff --git a/tim-worker/internal/llm_provider/google_test.go b/tim-worker/internal/llm_provider/google_test.go index f80dc24fe..23b0c02bd 100644 --- a/tim-worker/internal/llm_provider/google_test.go +++ b/tim-worker/internal/llm_provider/google_test.go @@ -11,7 +11,7 @@ import ( "github.com/Greybox-Labs/tim/shared/llm" "github.com/Greybox-Labs/tim/shared/logger" - llmresponse "github.com/Greybox-Labs/tim/tim-proto/gen/tim/api/llm_response/v1alpha1" + llmresponse "github.com/Greybox-Labs/tim/tim-proto/gen/tim/int/llm_response/v1alpha1" "github.com/Greybox-Labs/tim/tim-worker/internal/config" "google.golang.org/genai" ) diff --git a/tim-worker/internal/llm_provider/openai.go b/tim-worker/internal/llm_provider/openai.go index e3a8d5570..058140488 100644 --- a/tim-worker/internal/llm_provider/openai.go +++ b/tim-worker/internal/llm_provider/openai.go @@ -6,7 +6,7 @@ import ( "io" "github.com/Greybox-Labs/tim/shared/llm" - llmresponse "github.com/Greybox-Labs/tim/tim-proto/gen/tim/api/llm_response/v1alpha1" + llmresponse "github.com/Greybox-Labs/tim/tim-proto/gen/tim/int/llm_response/v1alpha1" "github.com/Greybox-Labs/tim/tim-worker/internal/config" "github.com/openai/openai-go/v3" "github.com/openai/openai-go/v3/option" diff --git a/tim-worker/internal/llm_provider/openai_test.go b/tim-worker/internal/llm_provider/openai_test.go index 54643e8e4..57de4441e 100644 --- a/tim-worker/internal/llm_provider/openai_test.go +++ b/tim-worker/internal/llm_provider/openai_test.go @@ -10,7 +10,7 @@ import ( "testing" "github.com/Greybox-Labs/tim/shared/llm" - llmresponse "github.com/Greybox-Labs/tim/tim-proto/gen/tim/api/llm_response/v1alpha1" + llmresponse "github.com/Greybox-Labs/tim/tim-proto/gen/tim/int/llm_response/v1alpha1" "github.com/Greybox-Labs/tim/tim-worker/internal/config" "github.com/openai/openai-go/v3" ) diff --git a/tim-worker/internal/llm_provider/provider.go b/tim-worker/internal/llm_provider/provider.go index 0458cef44..2417e8df0 100644 --- a/tim-worker/internal/llm_provider/provider.go +++ b/tim-worker/internal/llm_provider/provider.go @@ -4,7 +4,7 @@ import ( "context" "github.com/Greybox-Labs/tim/shared/llm" - llmresponsev1 "github.com/Greybox-Labs/tim/tim-proto/gen/tim/api/llm_response/v1alpha1" + llmresponsev1 "github.com/Greybox-Labs/tim/tim-proto/gen/tim/int/llm_response/v1alpha1" ) // StreamingProvider defines the interface for LLM providers with streaming support diff --git a/tim-worker/internal/worker/handle_count_tokens.go b/tim-worker/internal/worker/handle_count_tokens.go index de897bb76..1cfa6a54a 100644 --- a/tim-worker/internal/worker/handle_count_tokens.go +++ b/tim-worker/internal/worker/handle_count_tokens.go @@ -6,7 +6,7 @@ import ( "fmt" "github.com/Greybox-Labs/tim/shared/llm" - llmresponse "github.com/Greybox-Labs/tim/tim-proto/gen/tim/api/llm_response/v1alpha1" + llmresponse "github.com/Greybox-Labs/tim/tim-proto/gen/tim/int/llm_response/v1alpha1" ) // handleCountTokens handles count tokens jobs (fallback when streaming fails) diff --git a/tim-worker/internal/worker/handle_llm_relay.go b/tim-worker/internal/worker/handle_llm_relay.go index c02a628d8..5412dadaa 100644 --- a/tim-worker/internal/worker/handle_llm_relay.go +++ b/tim-worker/internal/worker/handle_llm_relay.go @@ -8,9 +8,9 @@ import ( "github.com/Greybox-Labs/tim/shared/llm" "github.com/Greybox-Labs/tim/shared/proto" "github.com/Greybox-Labs/tim/shared/tools" - llmresponse "github.com/Greybox-Labs/tim/tim-proto/gen/tim/api/llm_response/v1alpha1" thread "github.com/Greybox-Labs/tim/tim-proto/gen/tim/api/thread/v1alpha1" - threadcontext "github.com/Greybox-Labs/tim/tim-proto/gen/tim/api/thread_context/v1alpha1" + llmresponse "github.com/Greybox-Labs/tim/tim-proto/gen/tim/int/llm_response/v1alpha1" + threadcontext "github.com/Greybox-Labs/tim/tim-proto/gen/tim/int/thread_context/v1alpha1" "github.com/Greybox-Labs/tim/tim-worker/internal/llm_provider" ) diff --git a/tim-worker/internal/worker/handle_llm_relay_test.go b/tim-worker/internal/worker/handle_llm_relay_test.go index f835e01e2..d7e9cd55c 100644 --- a/tim-worker/internal/worker/handle_llm_relay_test.go +++ b/tim-worker/internal/worker/handle_llm_relay_test.go @@ -7,7 +7,7 @@ import ( "github.com/Greybox-Labs/tim/shared/llm" "github.com/Greybox-Labs/tim/shared/logger" thread "github.com/Greybox-Labs/tim/tim-proto/gen/tim/api/thread/v1alpha1" - threadcontext "github.com/Greybox-Labs/tim/tim-proto/gen/tim/api/thread_context/v1alpha1" + threadcontext "github.com/Greybox-Labs/tim/tim-proto/gen/tim/int/thread_context/v1alpha1" "github.com/Greybox-Labs/tim/tim-worker/internal/config" )