-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathagents.ts
More file actions
1958 lines (1653 loc) · 42.9 KB
/
agents.ts
File metadata and controls
1958 lines (1653 loc) · 42.9 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
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { sleep } from '../../internal/utils';
import { APIResource } from '../../core/resource';
import * as AgentsAPI from './agents';
import * as Shared from '../shared';
import * as APIKeysAPI from './api-keys';
import { GradientError } from '../../core/error';
import {
APIKeyCreateParams,
APIKeyCreateResponse,
APIKeyDeleteParams,
APIKeyDeleteResponse,
APIKeyListParams,
APIKeyListResponse,
APIKeyRegenerateParams,
APIKeyRegenerateResponse,
APIKeyUpdateParams,
APIKeyUpdateResponse,
APIKeys,
} from './api-keys';
import * as EvaluationDatasetsAPI from './evaluation-datasets';
import {
EvaluationDatasetCreateFileUploadPresignedURLsParams,
EvaluationDatasetCreateFileUploadPresignedURLsResponse,
EvaluationDatasetCreateParams,
EvaluationDatasetCreateResponse,
EvaluationDatasets,
} from './evaluation-datasets';
import * as EvaluationRunsAPI from './evaluation-runs';
import {
APIEvaluationMetric,
APIEvaluationMetricResult,
APIEvaluationPrompt,
APIEvaluationRun,
EvaluationRunCreateParams,
EvaluationRunCreateResponse,
EvaluationRunListResultsParams,
EvaluationRunListResultsResponse,
EvaluationRunRetrieveResponse,
EvaluationRunRetrieveResultsParams,
EvaluationRunRetrieveResultsResponse,
EvaluationRuns,
} from './evaluation-runs';
import * as EvaluationTestCasesAPI from './evaluation-test-cases';
import {
APIEvaluationTestCase,
APIStarMetric,
EvaluationTestCaseCreateParams,
EvaluationTestCaseCreateResponse,
EvaluationTestCaseListEvaluationRunsParams,
EvaluationTestCaseListEvaluationRunsResponse,
EvaluationTestCaseListResponse,
EvaluationTestCaseRetrieveParams,
EvaluationTestCaseRetrieveResponse,
EvaluationTestCaseUpdateParams,
EvaluationTestCaseUpdateResponse,
EvaluationTestCases,
} from './evaluation-test-cases';
import * as FunctionsAPI from './functions';
import {
FunctionCreateParams,
FunctionCreateResponse,
FunctionDeleteParams,
FunctionDeleteResponse,
FunctionUpdateParams,
FunctionUpdateResponse,
Functions,
} from './functions';
import * as KnowledgeBasesAPI from './knowledge-bases';
import {
APILinkKnowledgeBaseOutput,
KnowledgeBaseAttachSingleParams,
KnowledgeBaseDetachParams,
KnowledgeBaseDetachResponse,
KnowledgeBases,
} from './knowledge-bases';
import * as RoutesAPI from './routes';
import {
RouteAddParams,
RouteAddResponse,
RouteDeleteParams,
RouteDeleteResponse,
RouteUpdateParams,
RouteUpdateResponse,
RouteViewResponse,
Routes,
} from './routes';
import * as VersionsAPI from './versions';
import {
VersionListParams,
VersionListResponse,
VersionUpdateParams,
VersionUpdateResponse,
Versions,
} from './versions';
import * as KnowledgeBasesKnowledgeBasesAPI from '../knowledge-bases/knowledge-bases';
import * as ModelsAPI from '../models/models';
import * as ChatAPI from './chat/chat';
import { Chat } from './chat/chat';
import * as EvaluationMetricsAPI from './evaluation-metrics/evaluation-metrics';
import {
EvaluationMetricListRegionsParams,
EvaluationMetricListRegionsResponse,
EvaluationMetricListResponse,
EvaluationMetrics,
} from './evaluation-metrics/evaluation-metrics';
import { APIPromise } from '../../core/api-promise';
import { RequestOptions } from '../../internal/request-options';
import { path } from '../../internal/utils/path';
type AgentStatus = NonNullable<APIAgent.Deployment['status']>;
export interface WaitForAgentOptions extends RequestOptions {
/** Check interval in ms (default: 3000) */
interval?: number;
}
export class AgentTimeoutError extends GradientError {
constructor(
public agentId: string,
public timeoutMs: number,
) {
super(`Agent ${agentId} did not become ready within ${timeoutMs}ms`);
this.name = 'AgentTimeoutError';
}
}
export class AgentDeploymentError extends GradientError {
constructor(
public agentId: string,
public status: AgentStatus,
) {
super(`Agent ${agentId} deployment failed with status: ${status}`);
this.name = 'AgentDeploymentError';
}
}
export class Agents extends APIResource {
apiKeys: APIKeysAPI.APIKeys = new APIKeysAPI.APIKeys(this._client);
chat: ChatAPI.Chat = new ChatAPI.Chat(this._client);
evaluationMetrics: EvaluationMetricsAPI.EvaluationMetrics = new EvaluationMetricsAPI.EvaluationMetrics(
this._client,
);
evaluationRuns: EvaluationRunsAPI.EvaluationRuns = new EvaluationRunsAPI.EvaluationRuns(this._client);
evaluationTestCases: EvaluationTestCasesAPI.EvaluationTestCases =
new EvaluationTestCasesAPI.EvaluationTestCases(this._client);
evaluationDatasets: EvaluationDatasetsAPI.EvaluationDatasets = new EvaluationDatasetsAPI.EvaluationDatasets(
this._client,
);
functions: FunctionsAPI.Functions = new FunctionsAPI.Functions(this._client);
versions: VersionsAPI.Versions = new VersionsAPI.Versions(this._client);
knowledgeBases: KnowledgeBasesAPI.KnowledgeBases = new KnowledgeBasesAPI.KnowledgeBases(this._client);
routes: RoutesAPI.Routes = new RoutesAPI.Routes(this._client);
/**
* To create a new agent, send a POST request to `/v2/gen-ai/agents`. The response
* body contains a JSON object with the newly created agent object.
*
* @example
* ```ts
* const agent = await client.agents.create();
* ```
*/
create(
body: AgentCreateParams | null | undefined = {},
options?: RequestOptions,
): APIPromise<AgentCreateResponse> {
return this._client.post('/v2/gen-ai/agents', {
body,
defaultBaseURL: 'https://api.digitalocean.com',
...options,
});
}
/**
* To retrieve details of an agent, GET request to `/v2/gen-ai/agents/{uuid}`. The
* response body is a JSON object containing the agent.
*
* @example
* ```ts
* const agent = await client.agents.retrieve(
* '"123e4567-e89b-12d3-a456-426614174000"',
* );
* ```
*/
retrieve(uuid: string, options?: RequestOptions): APIPromise<AgentRetrieveResponse> {
return this._client.get(path`/v2/gen-ai/agents/${uuid}`, {
defaultBaseURL: 'https://api.digitalocean.com',
...options,
});
}
/**
* To update an agent, send a PUT request to `/v2/gen-ai/agents/{uuid}`. The
* response body is a JSON object containing the agent.
*
* @example
* ```ts
* const agent = await client.agents.update(
* '"123e4567-e89b-12d3-a456-426614174000"',
* );
* ```
*/
update(
pathUuid: string,
body: AgentUpdateParams | null | undefined = {},
options?: RequestOptions,
): APIPromise<AgentUpdateResponse> {
return this._client.put(path`/v2/gen-ai/agents/${pathUuid}`, {
body,
defaultBaseURL: 'https://api.digitalocean.com',
...options,
});
}
/**
* To list all agents, send a GET request to `/v2/gen-ai/agents`.
*
* @example
* ```ts
* const agents = await client.agents.list();
* ```
*/
list(
query: AgentListParams | null | undefined = {},
options?: RequestOptions,
): APIPromise<AgentListResponse> {
return this._client.get('/v2/gen-ai/agents', {
query,
defaultBaseURL: 'https://api.digitalocean.com',
...options,
});
}
/**
* To delete an agent, send a DELETE request to `/v2/gen-ai/agents/{uuid}`.
*
* @example
* ```ts
* const agent = await client.agents.delete(
* '"123e4567-e89b-12d3-a456-426614174000"',
* );
* ```
*/
delete(uuid: string, options?: RequestOptions): APIPromise<AgentDeleteResponse> {
return this._client.delete(path`/v2/gen-ai/agents/${uuid}`, {
defaultBaseURL: 'https://api.digitalocean.com',
...options,
});
}
/**
* To get agent usage, send a GET request to `/v2/gen-ai/agents/{uuid}/usage`.
* Returns usage metrics for the specified agent within the provided time range.
*
* @example
* ```ts
* const response = await client.agents.retrieveUsage(
* '"123e4567-e89b-12d3-a456-426614174000"',
* );
* ```
*/
retrieveUsage(
uuid: string,
query: AgentRetrieveUsageParams | null | undefined = {},
options?: RequestOptions,
): APIPromise<AgentRetrieveUsageResponse> {
return this._client.get(path`/v2/gen-ai/agents/${uuid}/usage`, {
query,
defaultBaseURL: 'https://api.digitalocean.com',
...options,
});
}
/**
* Check whether an agent is public or private. To update the agent status, send a
* PUT request to `/v2/gen-ai/agents/{uuid}/deployment_visibility`.
*
* @example
* ```ts
* const response = await client.agents.updateStatus(
* '"123e4567-e89b-12d3-a456-426614174000"',
* );
* ```
*/
updateStatus(
pathUuid: string,
body: AgentUpdateStatusParams | null | undefined = {},
options?: RequestOptions,
): APIPromise<AgentUpdateStatusResponse> {
return this._client.put(path`/v2/gen-ai/agents/${pathUuid}/deployment_visibility`, {
body,
defaultBaseURL: 'https://api.digitalocean.com',
...options,
});
}
/**
* Polls for agent readiness.
*
* @example
* ```typescript
* const agent = await waitForAgentReady(client, 'agent-123', {
* timeout: 60000, // 1 minute
* });
* ```
*/
async waitForReady(uuid: string, options: WaitForAgentOptions = {}): Promise<AgentReadinessResponse> {
const { interval = 3000, timeout = 180000, signal } = options;
const start = Date.now();
let pollCount = 0;
let currentInterval = interval;
while (true) {
signal?.throwIfAborted();
const elapsed = Date.now() - start;
// ⏰ Check timeout BEFORE making the API call
if (elapsed > timeout) {
throw new AgentTimeoutError(uuid, timeout);
}
const agent = await this.retrieve(uuid, options);
const status = (agent.agent?.deployment?.status as AgentStatus) || 'STATUS_UNKNOWN';
if (status === 'STATUS_RUNNING') {
return agent;
}
if (status === 'STATUS_FAILED' || status === 'STATUS_UNDEPLOYMENT_FAILED') {
throw new AgentDeploymentError(uuid, status);
}
await sleep(currentInterval);
// Apply exponential backoff: double the interval after each poll, up to maxInterval
pollCount++;
if (pollCount > 2) {
// Start exponential backoff after 2 polls
currentInterval = Math.min(currentInterval * 2, 30000);
}
}
}
}
/**
* An Agent
*/
export interface APIAgent {
/**
* Anthropic API Key Info
*/
anthropic_api_key?: APIAnthropicAPIKeyInfo;
/**
* Api key infos
*/
api_key_infos?: Array<APIAgentAPIKeyInfo>;
/**
* Api keys
*/
api_keys?: Array<APIAgent.APIKey>;
/**
* A Chatbot
*/
chatbot?: APIAgent.Chatbot;
/**
* Chatbot identifiers
*/
chatbot_identifiers?: Array<APIAgent.ChatbotIdentifier>;
/**
* Child agents
*/
child_agents?: Array<APIAgent>;
/**
* Whether conversation logs are enabled for the agent
*/
conversation_logs_enabled?: boolean;
/**
* Creation date / time
*/
created_at?: string;
/**
* Description of deployment
*/
deployment?: APIAgent.Deployment;
/**
* Description of agent
*/
description?: string;
functions?: Array<APIAgent.Function>;
/**
* The guardrails the agent is attached to
*/
guardrails?: Array<APIAgent.Guardrail>;
if_case?: string;
/**
* Agent instruction. Instructions help your agent to perform its job effectively.
* See
* [Write Effective Agent Instructions](https://docs.digitalocean.com/products/genai-platform/concepts/best-practices/#agent-instructions)
* for best practices.
*/
instruction?: string;
k?: number;
/**
* Knowledge bases
*/
knowledge_bases?: Array<KnowledgeBasesKnowledgeBasesAPI.APIKnowledgeBase>;
logging_config?: APIAgent.LoggingConfig;
max_tokens?: number;
/**
* Description of a Model
*/
model?: APIAgentModel;
/**
* Agent name
*/
name?: string;
/**
* OpenAI API Key Info
*/
openai_api_key?: APIOpenAIAPIKeyInfo;
/**
* Parent agents
*/
parent_agents?: Array<APIAgent>;
project_id?: string;
/**
* Whether the agent should provide in-response citations
*/
provide_citations?: boolean;
/**
* Region code
*/
region?: string;
/**
* - RETRIEVAL_METHOD_UNKNOWN: The retrieval method is unknown
* - RETRIEVAL_METHOD_REWRITE: The retrieval method is rewrite
* - RETRIEVAL_METHOD_STEP_BACK: The retrieval method is step back
* - RETRIEVAL_METHOD_SUB_QUERIES: The retrieval method is sub queries
* - RETRIEVAL_METHOD_NONE: The retrieval method is none
*/
retrieval_method?: APIRetrievalMethod;
/**
* Creation of route date / time
*/
route_created_at?: string;
route_created_by?: string;
/**
* Route name
*/
route_name?: string;
route_uuid?: string;
/**
* Agent tag to organize related resources
*/
tags?: Array<string>;
temperature?: number;
/**
* Represents an AgentTemplate entity
*/
template?: APIAgent.Template;
top_p?: number;
/**
* Last modified
*/
updated_at?: string;
/**
* Access your agent under this url
*/
url?: string;
/**
* Id of user that created the agent
*/
user_id?: string;
/**
* Unique agent id
*/
uuid?: string;
/**
* The latest version of the agent
*/
version_hash?: string;
workspace?: APIWorkspace;
}
export namespace APIAgent {
/**
* Agent API Key
*/
export interface APIKey {
/**
* Api key
*/
api_key?: string;
}
/**
* A Chatbot
*/
export interface Chatbot {
button_background_color?: string;
logo?: string;
/**
* Name of chatbot
*/
name?: string;
primary_color?: string;
secondary_color?: string;
starting_message?: string;
}
/**
* Agent Chatbot Identifier
*/
export interface ChatbotIdentifier {
/**
* Agent chatbot identifier
*/
agent_chatbot_identifier?: string;
}
/**
* Description of deployment
*/
export interface Deployment {
/**
* Creation date / time
*/
created_at?: string;
/**
* Name
*/
name?: string;
status?:
| 'STATUS_UNKNOWN'
| 'STATUS_WAITING_FOR_DEPLOYMENT'
| 'STATUS_DEPLOYING'
| 'STATUS_RUNNING'
| 'STATUS_FAILED'
| 'STATUS_WAITING_FOR_UNDEPLOYMENT'
| 'STATUS_UNDEPLOYING'
| 'STATUS_UNDEPLOYMENT_FAILED'
| 'STATUS_DELETED';
/**
* Last modified
*/
updated_at?: string;
/**
* Access your deployed agent here
*/
url?: string;
/**
* Unique id
*/
uuid?: string;
/**
* - VISIBILITY_UNKNOWN: The status of the deployment is unknown
* - VISIBILITY_DISABLED: The deployment is disabled and will no longer service
* requests
* - VISIBILITY_PLAYGROUND: Deprecated: No longer a valid state
* - VISIBILITY_PUBLIC: The deployment is public and will service requests from the
* public internet
* - VISIBILITY_PRIVATE: The deployment is private and will only service requests
* from other agents, or through API keys
*/
visibility?: AgentsAPI.APIDeploymentVisibility;
}
/**
* Description missing
*/
export interface Function {
/**
* Api key
*/
api_key?: string;
/**
* Creation date / time
*/
created_at?: string;
/**
* Created by user id from DO
*/
created_by?: string;
/**
* Agent description
*/
description?: string;
faas_name?: string;
faas_namespace?: string;
input_schema?: unknown;
/**
* Name
*/
name?: string;
output_schema?: unknown;
/**
* Last modified
*/
updated_at?: string;
/**
* Download your agent here
*/
url?: string;
/**
* Unique id
*/
uuid?: string;
}
/**
* A Agent Guardrail
*/
export interface Guardrail {
agent_uuid?: string;
created_at?: string;
default_response?: string;
description?: string;
guardrail_uuid?: string;
is_attached?: boolean;
is_default?: boolean;
metadata?: unknown;
name?: string;
priority?: number;
type?:
| 'GUARDRAIL_TYPE_UNKNOWN'
| 'GUARDRAIL_TYPE_JAILBREAK'
| 'GUARDRAIL_TYPE_SENSITIVE_DATA'
| 'GUARDRAIL_TYPE_CONTENT_MODERATION';
updated_at?: string;
uuid?: string;
}
export interface LoggingConfig {
/**
* Galileo project identifier
*/
galileo_project_id?: string;
/**
* Name of the Galileo project
*/
galileo_project_name?: string;
/**
* Whether insights are enabled
*/
insights_enabled?: boolean;
/**
* Timestamp when insights were enabled
*/
insights_enabled_at?: string;
/**
* Identifier for the log stream
*/
log_stream_id?: string;
/**
* Name of the log stream
*/
log_stream_name?: string;
}
/**
* Represents an AgentTemplate entity
*/
export interface Template {
/**
* The agent template's creation date
*/
created_at?: string;
/**
* Deprecated - Use summary instead
*/
description?: string;
/**
* List of guardrails associated with the agent template
*/
guardrails?: Array<Template.Guardrail>;
/**
* Instructions for the agent template
*/
instruction?: string;
/**
* The 'k' value for the agent template
*/
k?: number;
/**
* List of knowledge bases associated with the agent template
*/
knowledge_bases?: Array<KnowledgeBasesKnowledgeBasesAPI.APIKnowledgeBase>;
/**
* The long description of the agent template
*/
long_description?: string;
/**
* The max_tokens setting for the agent template
*/
max_tokens?: number;
/**
* Description of a Model
*/
model?: AgentsAPI.APIAgentModel;
/**
* Name of the agent template
*/
name?: string;
/**
* The short description of the agent template
*/
short_description?: string;
/**
* The summary of the agent template
*/
summary?: string;
/**
* List of tags associated with the agent template
*/
tags?: Array<string>;
/**
* The temperature setting for the agent template
*/
temperature?: number;
/**
* - AGENT_TEMPLATE_TYPE_STANDARD: The standard agent template
* - AGENT_TEMPLATE_TYPE_ONE_CLICK: The one click agent template
*/
template_type?: 'AGENT_TEMPLATE_TYPE_STANDARD' | 'AGENT_TEMPLATE_TYPE_ONE_CLICK';
/**
* The top_p setting for the agent template
*/
top_p?: number;
/**
* The agent template's last updated date
*/
updated_at?: string;
/**
* Unique id
*/
uuid?: string;
}
export namespace Template {
export interface Guardrail {
/**
* Priority of the guardrail
*/
priority?: number;
/**
* Uuid of the guardrail
*/
uuid?: string;
}
}
}
/**
* Agent API Key Info
*/
export interface APIAgentAPIKeyInfo {
/**
* Creation date
*/
created_at?: string;
/**
* Created by
*/
created_by?: string;
/**
* Deleted date
*/
deleted_at?: string;
/**
* Name
*/
name?: string;
secret_key?: string;
/**
* Uuid
*/
uuid?: string;
}
/**
* Description of a Model
*/
export interface APIAgentModel {
/**
* Agreement Description
*/
agreement?: ModelsAPI.APIAgreement;
/**
* Creation date / time
*/
created_at?: string;
/**
* Internally used name
*/
inference_name?: string;
/**
* Internally used version
*/
inference_version?: string;
/**
* True if it is a foundational model provided by do
*/
is_foundational?: boolean;
/**
* Additional meta data
*/
metadata?: unknown;
/**
* Name of the model
*/
name?: string;
/**
* Unique id of the model, this model is based on
*/
parent_uuid?: string;
provider?: 'MODEL_PROVIDER_DIGITALOCEAN' | 'MODEL_PROVIDER_ANTHROPIC' | 'MODEL_PROVIDER_OPENAI';
/**
* Last modified
*/
updated_at?: string;
/**
* Model has been fully uploaded
*/
upload_complete?: boolean;
/**
* Download url
*/
url?: string;
/**
* Usecases of the model
*/
usecases?: Array<
| 'MODEL_USECASE_UNKNOWN'
| 'MODEL_USECASE_AGENT'
| 'MODEL_USECASE_FINETUNED'
| 'MODEL_USECASE_KNOWLEDGEBASE'
| 'MODEL_USECASE_GUARDRAIL'
| 'MODEL_USECASE_REASONING'
| 'MODEL_USECASE_SERVERLESS'
>;
/**
* Unique id
*/
uuid?: string;
/**
* Version Information about a Model
*/
version?: ModelsAPI.APIModelVersion;
}
/**
* Anthropic API Key Info
*/
export interface APIAnthropicAPIKeyInfo {
/**
* Key creation date
*/
created_at?: string;
/**
* Created by user id from DO
*/
created_by?: string;
/**
* Key deleted date
*/
deleted_at?: string;
/**
* Name
*/
name?: string;
/**
* Key last updated date
*/
updated_at?: string;
/**
* Uuid
*/