-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(agent): add agent contract (#523)
Because we are going to remove the app-related api This commit adds api for agent --------- Co-authored-by: droplet-bot <[email protected]>
- Loading branch information
1 parent
03e0861
commit 7b8b548
Showing
4 changed files
with
472 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,29 @@ package app.app.v1alpha; | |
|
||
// Google API | ||
import "google/api/field_behavior.proto"; | ||
import "google/protobuf/struct.proto"; | ||
import "google/protobuf/timestamp.proto"; | ||
|
||
// Agent represents a agent. | ||
message Agent { | ||
// agent uid | ||
string agent_uid = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; | ||
// The agent display name. | ||
string display_name = 2 [(google.api.field_behavior) = REQUIRED]; | ||
// The agent description. | ||
string description = 3 [(google.api.field_behavior) = OPTIONAL]; | ||
// The namespace of the agent. | ||
string namespace_uid = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; | ||
// The agent tags. | ||
repeated string tags = 5 [(google.api.field_behavior) = OPTIONAL]; | ||
// The agent metadata. | ||
AIAgentAppMetadata ai_agent_metadata = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; | ||
// creator uid | ||
string creator_uid = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; | ||
// The creation time of the agent. | ||
google.protobuf.Timestamp create_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; | ||
// The last update time of the agent. | ||
google.protobuf.Timestamp update_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; | ||
} | ||
|
||
// AIAgentAppMetadata represents the metadata for the AI agent app. | ||
message AIAgentAppMetadata { | ||
|
@@ -22,8 +44,85 @@ message AIAgentAppMetadata { | |
|
||
// tool definitions | ||
message Tool { | ||
// The tool name. e.g. ["preset/[email protected]", "preset/[email protected]"]. | ||
string name = 1 [(google.api.field_behavior) = REQUIRED]; | ||
// The tool config | ||
google.protobuf.Struct config = 3 [(google.api.field_behavior) = OPTIONAL]; | ||
// The pipeline id of the tool. e.g. "preset/xxx-search" | ||
string pipeline_id = 1 [(google.api.field_behavior) = OPTIONAL]; | ||
// The tool name. | ||
optional string name = 2 [(google.api.field_behavior) = OPTIONAL]; | ||
// The tool connection key(variable) and value(id). | ||
map<string, string> config = 3 [(google.api.field_behavior) = OPTIONAL]; | ||
} | ||
|
||
// CreateAgentRequest represents a request to create a agent. | ||
message CreateAgentRequest { | ||
// The app's owner(namespaces). | ||
string namespace_id = 1 [(google.api.field_behavior) = REQUIRED]; | ||
// The agent display name. | ||
string display_name = 2 [(google.api.field_behavior) = OPTIONAL]; | ||
// The agent description. | ||
string description = 3 [(google.api.field_behavior) = OPTIONAL]; | ||
// The agent tags. | ||
repeated string tags = 4 [(google.api.field_behavior) = OPTIONAL]; | ||
// The agent metadata. | ||
AIAgentAppMetadata ai_agent_app = 5 [(google.api.field_behavior) = OPTIONAL]; | ||
} | ||
|
||
// CreateAgentResponse represents a response for creating a agent. | ||
message CreateAgentResponse { | ||
// The created agent. | ||
Agent agent = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; | ||
} | ||
|
||
// ListAgentsRequest represents a request to list agents. | ||
message ListAgentsRequest { | ||
// The app's owner(namespaces). | ||
string namespace_id = 1 [(google.api.field_behavior) = REQUIRED]; | ||
} | ||
|
||
// ListAgentsResponse represents a response for listing agents. | ||
message ListAgentsResponse { | ||
// The agents. | ||
repeated Agent agents = 1; | ||
} | ||
|
||
// UpdateAgentRequest represents a request to update a agent. | ||
message UpdateAgentRequest { | ||
// The app's owner(namespaces). | ||
string namespace_id = 1 [(google.api.field_behavior) = REQUIRED]; | ||
// The agent uid. | ||
string agent_uid = 2 [(google.api.field_behavior) = REQUIRED]; | ||
// The agent description. | ||
string description = 3 [(google.api.field_behavior) = OPTIONAL]; | ||
// The agent tags. | ||
repeated string tags = 4 [(google.api.field_behavior) = OPTIONAL]; | ||
// The agent metadata. | ||
AIAgentAppMetadata ai_agent_app = 5 [(google.api.field_behavior) = OPTIONAL]; | ||
} | ||
|
||
// UpdateAgentResponse represents a response for updating a agent. | ||
message UpdateAgentResponse { | ||
// The updated agent. | ||
Agent agent = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; | ||
} | ||
|
||
// DeleteAgentRequest represents a request to delete a agent. | ||
message DeleteAgentRequest { | ||
// The app's owner(namespaces). | ||
string namespace_id = 1 [(google.api.field_behavior) = REQUIRED]; | ||
// The agent uid. | ||
string agent_uid = 2 [(google.api.field_behavior) = REQUIRED]; | ||
} | ||
|
||
// DeleteAgentResponse represents a response for deleting a agent. | ||
message DeleteAgentResponse {} | ||
|
||
// ListToolsRequest represents a request to list tools. | ||
message ListToolsRequest { | ||
// The app's owner(namespaces). | ||
string namespace_id = 1 [(google.api.field_behavior) = REQUIRED]; | ||
} | ||
|
||
// ListToolsResponse represents a response for listing tools. | ||
message ListToolsResponse { | ||
// The tools. | ||
repeated Tool tools = 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.