Skip to content

Commit c985065

Browse files
committed
Update and add AI endpoints
1 parent 00b624b commit c985065

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+5484
-79
lines changed

Diff for: Sakefile

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ read = require 'read-yaml'
99
write = require 'write-data'
1010

1111
specs =
12+
ai: '5ae0ef89fa0ec6000345c836'
1213
blockchain:'5ae0ef89fa0ec6000345c836'
1314
commerce: '5ae1133468153700036bd21d'
1415
identity: '5adf8fa75620ce0003495003'

Diff for: ai/agent.yaml

+188
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
swagger: '2.0'
2+
info:
3+
version: v1.0
4+
title: Agent API
5+
description: >
6+
This API allows for the creation and management of customized agents (LLMs) with their own vector embeddings, and chat history management.
7+
8+
host: api.hanzo.ai
9+
schemes:
10+
- https
11+
consumes:
12+
- application/json
13+
produces:
14+
- application/json
15+
securityDefinitions:
16+
oauth2:
17+
type: oauth2
18+
flow: password
19+
scopes: {}
20+
tokenUrl: 'https://api.hanzo.ai/auth'
21+
Authorization:
22+
name: Authorization
23+
type: apiKey
24+
in: header
25+
token:
26+
name: token
27+
type: apiKey
28+
in: query
29+
30+
paths:
31+
'/agent/{id}':
32+
parameters:
33+
- name: id
34+
in: path
35+
required: true
36+
type: string
37+
delete:
38+
operationId: deleteAgent
39+
description: >
40+
Deletes the requested agent. Cannot be undone.
41+
parameters:
42+
- name: token
43+
in: query
44+
required: false
45+
type: string
46+
description: The unique identifier for the agent.
47+
- name: Accept
48+
in: header
49+
required: false
50+
type: string
51+
responses:
52+
'204':
53+
description: 'Agent successfully deleted.'
54+
schema:
55+
type: object
56+
properties: {}
57+
58+
put:
59+
operationId: replaceAgent
60+
description: >
61+
Replaces the specified agent wholly. Any fields not passed are blanked.
62+
parameters:
63+
- name: body
64+
in: body
65+
schema:
66+
$ref: '#/definitions/Agent'
67+
responses:
68+
'200':
69+
description: 'Agent successfully replaced.'
70+
schema:
71+
$ref: '#/definitions/Agent'
72+
73+
patch:
74+
operationId: updateAgent
75+
description: >
76+
Updates an agent object piecemeal. Any fields not passed are not changed.
77+
parameters:
78+
- name: body
79+
in: body
80+
schema:
81+
$ref: '#/definitions/Agent'
82+
responses:
83+
'200':
84+
description: 'Agent successfully updated.'
85+
schema:
86+
$ref: '#/definitions/Agent'
87+
88+
get:
89+
operationId: getAgent
90+
description: >
91+
Returns the specified agent.
92+
responses:
93+
'200':
94+
description: 'Agent details retrieved successfully.'
95+
schema:
96+
$ref: '#/definitions/Agent'
97+
98+
'/agent':
99+
post:
100+
operationId: createAgent
101+
description: >
102+
Creates a new agent.
103+
parameters:
104+
- name: body
105+
in: body
106+
schema:
107+
$ref: '#/definitions/Agent'
108+
responses:
109+
'201':
110+
description: 'New agent created successfully.'
111+
schema:
112+
$ref: '#/definitions/Agent'
113+
114+
get:
115+
operationId: retrieveAllAgents
116+
description: >
117+
Returns a list of all available agents.
118+
parameters:
119+
- name: token
120+
in: query
121+
type: string
122+
- name: accept
123+
in: header
124+
type: string
125+
responses:
126+
'200':
127+
description: 'List of agents retrieved successfully.'
128+
schema:
129+
$ref: '#/definitions/AgentArray'
130+
131+
definitions:
132+
Agent:
133+
title: Agent
134+
type: object
135+
properties:
136+
id:
137+
type: string
138+
description: The hanzo-assigned guid to identify this agent.
139+
createdAt:
140+
type: string
141+
description: The time this agent was created. Conforms to RFC3339.
142+
updatedAt:
143+
type: string
144+
description: The time this agent was last updated. Conforms to RFC3339.
145+
embeddings:
146+
$ref: '#/definitions/VectorEmbeddings'
147+
chatHistory:
148+
$ref: '#/definitions/ChatHistory'
149+
150+
VectorEmbeddings:
151+
title: VectorEmbeddings
152+
description: The vector embeddings associated with the agent.
153+
type: object
154+
properties:
155+
vectors:
156+
type: array
157+
items:
158+
type: number
159+
description: A list of vector values.
160+
161+
ChatHistory:
162+
title: ChatHistory
163+
description: The chat history for the agent.
164+
type: array
165+
items:
166+
$ref: '#/definitions/ChatMessage'
167+
168+
ChatMessage:
169+
title: ChatMessage
170+
description: A single chat message in the agent's history.
171+
type: object
172+
properties:
173+
timestamp:
174+
type: string
175+
description: The time the message was sent. Conforms to RFC3339.
176+
sender:
177+
type: string
178+
description: The sender of the message.
179+
message:
180+
type: string
181+
description: The content of the message.
182+
183+
AgentArray:
184+
title: AgentArray
185+
description: An array of agents.
186+
type: array
187+
items:
188+
$ref: '#/definitions/Agent'

Diff for: ai/ai.yaml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
swagger: '2.0'
2+
info:
3+
version: v1.0
4+
title: Hanzo AI
5+
description: >
6+
Hanzo AI provides a set of APIs for building and managing agents.
7+
8+
host: api.hanzo.ai
9+
schemes:
10+
- https
11+
consumes:
12+
- application/json
13+
produces:
14+
- application/json
15+
16+
securityDefinitions:
17+
oauth2:
18+
type: oauth2
19+
flow: password
20+
scopes: {}
21+
tokenUrl: 'https://api.hanzo.ai/auth'
22+
Authorization:
23+
name: Authorization
24+
type: apiKey
25+
in: header
26+
token:
27+
name: token
28+
type: apiKey
29+
in: query
30+
31+
# 'x-headers':
32+
# - key: Authorization
33+
# value: SANDBOXTOKEN
34+
35+
'x-send-defaults': false
36+
'x-explorer-enabled': false
37+
'x-proxy-enabled': false
38+
'x-samples-enabled': true
39+
'x-samples-languages':
40+
- curl
41+
- node
42+
- go
43+
- java
44+
- php
45+
- python
46+
- ruby
47+
- swift
48+
49+
# See other .yaml files for full definition

0 commit comments

Comments
 (0)