Skip to content

Commit 06e3ffa

Browse files
committed
feat: add agent crud api and fix comments
1 parent 5cf45d4 commit 06e3ffa

File tree

3 files changed

+158
-3
lines changed

3 files changed

+158
-3
lines changed

src/openapi/agent.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
AplAgent:
2+
x-acl:
3+
platformAdmin:
4+
- create-any
5+
- read-any
6+
- update-any
7+
- delete-any
8+
teamAdmin:
9+
- create
10+
- read
11+
- update
12+
- delete
13+
teamMember:
14+
- create
15+
- read
16+
- update
17+
- delete
18+
19+
AplAgentSpec:
20+
type: object
21+
properties:
22+
knowledgeBase:
23+
type: string
24+
description: Name of the knowledge base to use
25+
example: "company-docs"
26+
foundationModel:
27+
type: string
28+
description: Name of the foundation model
29+
example: "meta-llama-3"
30+
agentInstructions:
31+
type: string
32+
description: Custom instructions for the agent
33+
example: "You are a helpful assistant that provides concise answers."
34+
required:
35+
- knowledgeBase
36+
- foundationModel
37+
- agentInstructions

src/openapi/aiModel.yaml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,20 @@ AplAIModelSpec:
1616
teamMember:
1717
- read
1818
properties:
19+
displayName:
20+
type: string
21+
description: User-friendly model display name
22+
example: Meta-llama-3
1923
modelEndpoint:
2024
type: string
2125
format: uri
26+
modelType:
27+
type: string
28+
enum:
29+
- foundation
30+
- embedding
31+
description: Model type, foundation for text generation, embedding for vector search
32+
example: foundation
2233
modelDimension:
2334
type: integer
2435
minimum: 1
@@ -27,5 +38,4 @@ AplAIModelSpec:
2738
example: 4096
2839
required:
2940
- modelEndpoint
30-
- modelDimension
3141
type: object

src/openapi/api.yaml

Lines changed: 110 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2471,10 +2471,10 @@ paths:
24712471
'200':
24722472
description: Successfully edited app values.
24732473

2474-
'/alpha/ai/llm':
2474+
'/alpha/ai/models':
24752475
get:
24762476
operationId: getAIModels
2477-
description: Get available LLMs
2477+
description: Get available shared AI models (foundation or embedding)
24782478
x-aclSchema: AplAIModel
24792479
responses:
24802480
'200':
@@ -2566,6 +2566,86 @@ paths:
25662566
'200':
25672567
description: Successfully deleted a team knowledge base
25682568

2569+
'/alpha/teams/{teamId}/agents':
2570+
parameters:
2571+
- $ref: '#/components/parameters/teamParams'
2572+
get:
2573+
operationId: getAplAgents
2574+
description: Get agents from a given team
2575+
x-aclSchema: AplAgent
2576+
responses:
2577+
'200':
2578+
description: Successfully obtained agents
2579+
content:
2580+
application/json:
2581+
schema:
2582+
type: array
2583+
items:
2584+
$ref: '#/components/schemas/AplAgentResponse'
2585+
post:
2586+
operationId: createAplAgent
2587+
description: Create a team agent
2588+
x-aclSchema: AplAgent
2589+
requestBody:
2590+
content:
2591+
application/json:
2592+
schema:
2593+
$ref: '#/components/schemas/AplAgentRequest'
2594+
description: Agent object
2595+
required: true
2596+
responses:
2597+
<<: *DefaultPostResponses
2598+
'200':
2599+
description: Successfully stored agent configuration
2600+
content:
2601+
application/json:
2602+
schema:
2603+
$ref: '#/components/schemas/AplAgentResponse'
2604+
2605+
'/alpha/teams/{teamId}/agents/{agentName}':
2606+
parameters:
2607+
- $ref: '#/components/parameters/teamParams'
2608+
- $ref: '#/components/parameters/agentParams'
2609+
get:
2610+
operationId: getAplAgent
2611+
description: Get an agent from a given team
2612+
x-aclSchema: AplAgent
2613+
responses:
2614+
<<: *DefaultGetResponses
2615+
'200':
2616+
description: Successfully obtained agent configuration
2617+
content:
2618+
application/json:
2619+
schema:
2620+
$ref: '#/components/schemas/AplAgentResponse'
2621+
put:
2622+
operationId: editAplAgent
2623+
description: Edit an agent from a given team
2624+
x-aclSchema: AplAgent
2625+
requestBody:
2626+
content:
2627+
application/json:
2628+
schema:
2629+
$ref: '#/components/schemas/AplAgentRequest'
2630+
description: Agent object that contains updated values
2631+
required: true
2632+
responses:
2633+
<<: *DefaultGetResponses
2634+
'200':
2635+
description: Successfully edited a team agent
2636+
content:
2637+
application/json:
2638+
schema:
2639+
$ref: '#/components/schemas/AplAgentResponse'
2640+
delete:
2641+
operationId: deleteAplAgent
2642+
description: Delete an agent from a given team
2643+
x-aclSchema: AplAgent
2644+
responses:
2645+
<<: *DefaultGetResponses
2646+
'200':
2647+
description: Successfully deleted a team agent
2648+
25692649
## -------------------------------------------- Servers
25702650
#
25712651
#servers:
@@ -2658,6 +2738,13 @@ components:
26582738
required: true
26592739
schema:
26602740
type: string
2741+
agentParams:
2742+
name: agentName
2743+
in: path
2744+
description: Name of the agent
2745+
required: true
2746+
schema:
2747+
type: string
26612748
securitySchemes:
26622749
groupAuthn:
26632750
type: apiKey
@@ -2752,6 +2839,27 @@ components:
27522839
- $ref: '#/components/schemas/AplAIModel'
27532840
- $ref: '#/components/schemas/aplMetadata'
27542841
- $ref: '#/components/schemas/aplStatusResponse'
2842+
AplAgent:
2843+
type: object
2844+
properties:
2845+
kind:
2846+
type: string
2847+
enum: [AplAgent]
2848+
spec:
2849+
$ref: 'agent.yaml#/AplAgentSpec'
2850+
required:
2851+
- kind
2852+
- spec
2853+
AplAgentRequest:
2854+
allOf:
2855+
- $ref: '#/components/schemas/AplAgent'
2856+
- $ref: '#/components/schemas/aplMetadata'
2857+
AplAgentResponse:
2858+
type: object
2859+
allOf:
2860+
- $ref: '#/components/schemas/AplAgent'
2861+
- $ref: '#/components/schemas/aplTeamMetadata'
2862+
- $ref: '#/components/schemas/aplStatusResponse'
27552863
AplBackup:
27562864
type: object
27572865
properties:

0 commit comments

Comments
 (0)