-
Notifications
You must be signed in to change notification settings - Fork 904
/
main.tsp
125 lines (100 loc) · 3.35 KB
/
main.tsp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
import "@typespec/http";
import "@typespec/openapi";
import "@typespec/versioning";
import "./agents";
import "./chat";
import "./docs";
import "./entries";
import "./executions";
import "./files";
import "./jobs";
import "./sessions";
import "./tasks";
import "./tools";
import "./users";
import "./versions.tsp";
using TypeSpec.Http;
using TypeSpec.OpenAPI;
using TypeSpec.Versioning;
using Versions;
//
// MAIN
//
/** Julep is a backend for creating stateful AI apps with background tasks and long-term memory easily. */
@service({
name: "julep-api",
title: "Julep API",
})
@versioned(ApiVersions)
@summary("A backend for creating stateful AI apps")
@info({
termsOfService: "https://julep.ai/terms",
contact: {
name: "Julep AI",
url: "https://julep.ai",
email: "[email protected]",
},
license: {
name: "Apache 2.0",
url: "https://www.apache.org/licenses/LICENSE-2.0.html",
},
})
@externalDocs("https://docs.julep.ai", "Julep API documentation")
@server(
"https://{serverEnv}.julep.ai/api",
"The julep cloud service endpoint",
{
@doc("The environment to use")
serverEnv?: "api" | "api-alpha" = "api-alpha",
}
)
@useAuth(
ApiKeyAuth<ApiKeyLocation.header, "Authorization"> | ApiKeyAuth<
ApiKeyLocation.header,
"X-Auth-Key"
>
)
namespace Api {
@route("/agents")
interface AgentsRoute extends Agents.Endpoints {}
@route("/agents/{id}/docs")
interface AgentDocsRoute extends Docs.AgentEndpoints {}
@route("/agents/{id}/search")
interface AgentsDocsSearchRoute extends Docs.SearchEndpoints<"Search Docs owned by an Agent"> {}
@route("/agents/{id}/tools")
interface AgentToolsRoute extends Tools.AgentEndpoints {}
@route("/users")
interface UsersRoute extends Users.Endpoints {}
@route("/users/{id}/docs")
interface UserDocsRoute extends Docs.UserEndpoints {}
@route("/users/{id}/search")
interface UserDocsSearchRoute extends Docs.SearchEndpoints<"Search Docs owned by a User"> {}
@route("/sessions")
interface SessionsRoute extends Sessions.Endpoints {}
@route("/sessions/{id}/history")
interface HistoryRoute extends Entries.Endpoints {}
@route("/sessions/{id}/chat")
interface ChatRoute extends Chat.Endpoints {}
@route("/embed")
interface EmbedRoute extends Docs.EmbedEndpoints {}
@route("/docs")
interface IndividualDocsRoute extends Docs.IndividualDocEndpoints {}
@route("/tasks")
interface TasksGetRoute extends Tasks.GetEndpoints {}
@route("/agents/{id}/tasks")
interface TasksRoute extends Tasks.Endpoints {}
@route("/agents/{parent_id}/tasks")
interface TasksCreateOrUpdateRoute extends Tasks.CreateOrUpdateEndpoints {}
@route("/tasks/{id}/executions")
interface TaskExecutionsRoute extends Executions.TaskEndpoints {}
@route("/executions")
interface ExecutionsRoute extends Executions.Endpoints, Executions.PublicEndpoints {}
@route("/executions/{id}/transitions")
interface ExecutionTransitionsRoute extends Executions.TransitionEndpoints {}
@route("/executions/{id}/transitions.stream")
interface ExecutionTransitionsStreamRoute extends Executions.TransitionStreamEndpoints {}
@route("/jobs")
interface JobRoute extends Jobs.Endpoints {}
@route("/files")
interface FilesRoute extends Files.Endpoints {}
}