-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathlogs.ts
More file actions
59 lines (42 loc) · 1.44 KB
/
logs.ts
File metadata and controls
59 lines (42 loc) · 1.44 KB
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
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../core/resource';
import { APIPromise } from '../core/api-promise';
import { RequestOptions } from '../internal/request-options';
export class Logs extends APIResource {
/**
* Return recent logs for the authenticated user (scoped by app_id).
*
* Args: hours: Number of hours of history to retrieve (default 4) - <= 4 hours:
* reads from local files - > 4 hours: queries logs.morphik.ai proxy (requires
* proxy endpoint)
*/
list(query: LogListParams | null | undefined = {}, options?: RequestOptions): APIPromise<LogListResponse> {
return this._client.get('/logs/', { query, ...options });
}
}
export type LogListResponse = Array<LogListResponse.LogListResponseItem>;
export namespace LogListResponse {
/**
* Public serialisable view of a telemetry event.
*/
export interface LogListResponseItem {
duration_ms: number;
operation_type: string;
status: string;
timestamp: string;
tokens_used: number;
user_id: string;
app_id?: string | null;
error?: string | null;
metadata?: { [key: string]: unknown } | null;
}
}
export interface LogListParams {
hours?: number;
limit?: number;
op_type?: string | null;
status?: string | null;
}
export declare namespace Logs {
export { type LogListResponse as LogListResponse, type LogListParams as LogListParams };
}