@ancplua/qyl-api-schema 0.5.9 → 0.5.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/api/routes.tsp CHANGED
@@ -9,6 +9,7 @@ import "../otel/logs.tsp";
9
9
  import "../otel/profiles.tsp";
10
10
  import "../models/session.tsp";
11
11
  import "../models/health.tsp";
12
+ import "../models/cost-etl-audit.tsp";
12
13
 
13
14
  using TypeSpec.Http;
14
15
  using TypeSpec.OpenAPI;
@@ -22,6 +23,7 @@ using Qyl.Api.Contracts.OTel.Enums;
22
23
  using Qyl.Api.Contracts.OTel.Profiles;
23
24
  using Qyl.Api.Contracts.Domains.Observe.Session;
24
25
  using Qyl.Api.Contracts.Health;
26
+ using Qyl.Api.Contracts.Cost;
25
27
 
26
28
  @service(#{ title: "qyl API" })
27
29
  namespace Qyl.Api.Contracts;
@@ -170,6 +172,32 @@ interface SessionsApi {
170
172
  ): SessionStats | ValidationError | UnauthorizedError | InternalServerError;
171
173
  }
172
174
 
175
+ // -----------------------------------------------------------------------------
176
+ // GenAI cost and ETL audit
177
+ // -----------------------------------------------------------------------------
178
+
179
+ @route("/api/v1/cost/etl-audit")
180
+ @tag("GenAI cost")
181
+ @useAuth(QylApiKeyHeaderAuth)
182
+ interface GenAiEtlAuditApi {
183
+ @get
184
+ report(
185
+ ...ProjectScopeHeader,
186
+ @query startTime?: utcDateTime,
187
+ @query endTime?: utcDateTime,
188
+ @query @minValue(1) @maxValue(100) limit?: int32 = 25,
189
+ ): GenAiEtlAuditReport | ValidationError | UnauthorizedError | InternalServerError;
190
+
191
+ @post
192
+ @route("/evaluate")
193
+ evaluate(
194
+ ...ProjectScopeHeader,
195
+ @query startTime?: utcDateTime,
196
+ @query endTime?: utcDateTime,
197
+ @body request: GenAiEtlAuditEvaluationRequest,
198
+ ): GenAiEtlAuditEvaluationResponse | ValidationError | UnauthorizedError | InternalServerError;
199
+ }
200
+
173
201
  // -----------------------------------------------------------------------------
174
202
  // Health
175
203
  // -----------------------------------------------------------------------------