@effect/ai-openai-compat 4.0.0-rc.118 → 4.0.0
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/README.md +15 -4
- package/dist/OpenAiClient.d.ts +43 -0
- package/dist/OpenAiClient.d.ts.map +1 -1
- package/dist/OpenAiClient.js +4 -0
- package/dist/OpenAiClient.js.map +1 -1
- package/dist/OpenAiEmbeddingModel.d.ts +8 -0
- package/dist/OpenAiEmbeddingModel.d.ts.map +1 -1
- package/dist/OpenAiEmbeddingModel.js +6 -0
- package/dist/OpenAiEmbeddingModel.js.map +1 -1
- package/dist/OpenAiLanguageModel.d.ts +23 -0
- package/dist/OpenAiLanguageModel.d.ts.map +1 -1
- package/dist/OpenAiLanguageModel.js +6 -0
- package/dist/OpenAiLanguageModel.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/OpenAiClient.ts +43 -0
- package/src/OpenAiEmbeddingModel.ts +11 -0
- package/src/OpenAiLanguageModel.ts +26 -0
- package/src/index.ts +3 -0
package/src/OpenAiClient.ts
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* typed helpers for non-streaming chat completions, streaming chat completions,
|
|
6
6
|
* and embedding requests.
|
|
7
7
|
*
|
|
8
|
+
* @stability unstable
|
|
8
9
|
* @since 4.0.0
|
|
9
10
|
*/
|
|
10
11
|
import type * as AiError from "effect/ai/AiError"
|
|
@@ -34,6 +35,7 @@ import { OpenAiConfig } from "./OpenAiConfig.ts"
|
|
|
34
35
|
* completions, streaming chat completions, and embeddings. Transport and
|
|
35
36
|
* schema decoding failures are mapped to `AiError`.
|
|
36
37
|
*
|
|
38
|
+
* @stability unstable
|
|
37
39
|
* @category services
|
|
38
40
|
* @since 4.0.0
|
|
39
41
|
*/
|
|
@@ -77,6 +79,7 @@ export interface Service {
|
|
|
77
79
|
* @see {@link layer} for providing the service from explicit options
|
|
78
80
|
* @see {@link layerConfig} for loading client settings from `Config`
|
|
79
81
|
*
|
|
82
|
+
* @stability unstable
|
|
80
83
|
* @category services
|
|
81
84
|
* @since 4.0.0
|
|
82
85
|
*/
|
|
@@ -87,6 +90,7 @@ export class OpenAiClient extends Context.Service<OpenAiClient, Service>()(
|
|
|
87
90
|
/**
|
|
88
91
|
* Configuration options used to construct an OpenAI-compatible client.
|
|
89
92
|
*
|
|
93
|
+
* @stability unstable
|
|
90
94
|
* @category options
|
|
91
95
|
* @since 4.0.0
|
|
92
96
|
*/
|
|
@@ -130,6 +134,7 @@ const withRedactedHeaders = Effect.updateService(
|
|
|
130
134
|
* @see {@link layer} for providing this client from explicit options
|
|
131
135
|
* @see {@link layerConfig} for loading client settings from `Config`
|
|
132
136
|
*
|
|
137
|
+
* @stability unstable
|
|
133
138
|
* @category constructors
|
|
134
139
|
* @since 4.0.0
|
|
135
140
|
*/
|
|
@@ -288,6 +293,7 @@ export const make = Effect.fnUntraced(
|
|
|
288
293
|
* @see {@link make} for constructing the client service effectfully
|
|
289
294
|
* @see {@link layerConfig} for loading client settings from `Config`
|
|
290
295
|
*
|
|
296
|
+
* @stability unstable
|
|
291
297
|
* @category layers
|
|
292
298
|
* @since 4.0.0
|
|
293
299
|
*/
|
|
@@ -312,6 +318,7 @@ export const layer = (options: Options): Layer.Layer<OpenAiClient, never, HttpCl
|
|
|
312
318
|
* @see {@link make} for constructing the client service effectfully
|
|
313
319
|
* @see {@link layer} for providing the client from already-resolved options
|
|
314
320
|
*
|
|
321
|
+
* @stability unstable
|
|
315
322
|
* @category layers
|
|
316
323
|
* @since 4.0.0
|
|
317
324
|
*/
|
|
@@ -352,6 +359,7 @@ type JsonObject = { readonly [x: string]: Schema.Json }
|
|
|
352
359
|
/**
|
|
353
360
|
* Optional response fields that can be requested with the `include` parameter.
|
|
354
361
|
*
|
|
362
|
+
* @stability unstable
|
|
355
363
|
* @category models
|
|
356
364
|
* @since 4.0.0
|
|
357
365
|
*/
|
|
@@ -363,6 +371,7 @@ export type IncludeEnum =
|
|
|
363
371
|
/**
|
|
364
372
|
* Lifecycle status shared by message, reasoning, and tool-call items.
|
|
365
373
|
*
|
|
374
|
+
* @stability unstable
|
|
366
375
|
* @category models
|
|
367
376
|
* @since 4.0.0
|
|
368
377
|
*/
|
|
@@ -391,6 +400,7 @@ type InputFileContent = {
|
|
|
391
400
|
/**
|
|
392
401
|
* Content blocks accepted in input messages.
|
|
393
402
|
*
|
|
403
|
+
* @stability unstable
|
|
394
404
|
* @category models
|
|
395
405
|
* @since 4.0.0
|
|
396
406
|
*/
|
|
@@ -399,6 +409,7 @@ export type InputContent = InputTextContent | InputImageContent | InputFileConte
|
|
|
399
409
|
/**
|
|
400
410
|
* Text content block used for model-provided reasoning summaries.
|
|
401
411
|
*
|
|
412
|
+
* @stability unstable
|
|
402
413
|
* @category models
|
|
403
414
|
* @since 4.0.0
|
|
404
415
|
*/
|
|
@@ -461,6 +472,7 @@ type FilePathAnnotation = {
|
|
|
461
472
|
/**
|
|
462
473
|
* Citation and file-path annotations attached to output text content.
|
|
463
474
|
*
|
|
475
|
+
* @stability unstable
|
|
464
476
|
* @category models
|
|
465
477
|
* @since 4.0.0
|
|
466
478
|
*/
|
|
@@ -500,6 +512,7 @@ type OutputMessage = {
|
|
|
500
512
|
* Reasoning output item containing encrypted reasoning content, summaries, and
|
|
501
513
|
* optional reasoning text.
|
|
502
514
|
*
|
|
515
|
+
* @stability unstable
|
|
503
516
|
* @category models
|
|
504
517
|
* @since 4.0.0
|
|
505
518
|
*/
|
|
@@ -557,6 +570,7 @@ type ItemReference = {
|
|
|
557
570
|
* Supports input messages, output messages, tool calls, tool outputs, reasoning
|
|
558
571
|
* items, custom tool interactions, and item references.
|
|
559
572
|
*
|
|
573
|
+
* @stability unstable
|
|
560
574
|
* @category models
|
|
561
575
|
* @since 4.0.0
|
|
562
576
|
*/
|
|
@@ -598,6 +612,7 @@ type CustomToolParam = {
|
|
|
598
612
|
/**
|
|
599
613
|
* Tool definitions that can be supplied to a Responses-style request.
|
|
600
614
|
*
|
|
615
|
+
* @stability unstable
|
|
601
616
|
* @category models
|
|
602
617
|
* @since 4.0.0
|
|
603
618
|
*/
|
|
@@ -627,6 +642,7 @@ type ToolChoice =
|
|
|
627
642
|
* Text output format configuration for plain text, JSON object, or JSON Schema
|
|
628
643
|
* responses.
|
|
629
644
|
*
|
|
645
|
+
* @stability unstable
|
|
630
646
|
* @category configuration
|
|
631
647
|
* @since 4.0.0
|
|
632
648
|
*/
|
|
@@ -649,6 +665,7 @@ export type TextResponseFormatConfiguration =
|
|
|
649
665
|
* Request options for creating a Responses-style response with an
|
|
650
666
|
* OpenAI-compatible provider.
|
|
651
667
|
*
|
|
668
|
+
* @stability unstable
|
|
652
669
|
* @category models
|
|
653
670
|
* @since 4.0.0
|
|
654
671
|
*/
|
|
@@ -689,6 +706,7 @@ export type CreateResponse = {
|
|
|
689
706
|
/**
|
|
690
707
|
* Token accounting reported on Responses-style response objects.
|
|
691
708
|
*
|
|
709
|
+
* @stability unstable
|
|
692
710
|
* @category models
|
|
693
711
|
* @since 4.0.0
|
|
694
712
|
*/
|
|
@@ -710,6 +728,7 @@ type OutputItem =
|
|
|
710
728
|
* Responses-style response object returned by compatible providers or embedded
|
|
711
729
|
* in response stream lifecycle events.
|
|
712
730
|
*
|
|
731
|
+
* @stability unstable
|
|
713
732
|
* @category models
|
|
714
733
|
* @since 4.0.0
|
|
715
734
|
*/
|
|
@@ -839,6 +858,7 @@ type UnknownResponseStreamEvent = {
|
|
|
839
858
|
/**
|
|
840
859
|
* Server-sent event shapes emitted by Responses-style response streams.
|
|
841
860
|
*
|
|
861
|
+
* @stability unstable
|
|
842
862
|
* @category streaming
|
|
843
863
|
* @since 4.0.0
|
|
844
864
|
*/
|
|
@@ -867,6 +887,7 @@ export type ResponseStreamEvent =
|
|
|
867
887
|
* string. The `index` field identifies the input item that produced this
|
|
868
888
|
* embedding.
|
|
869
889
|
*
|
|
890
|
+
* @stability unstable
|
|
870
891
|
* @category models
|
|
871
892
|
* @since 4.0.0
|
|
872
893
|
*/
|
|
@@ -879,6 +900,7 @@ export type Embedding = {
|
|
|
879
900
|
/**
|
|
880
901
|
* Request payload for the embeddings endpoint.
|
|
881
902
|
*
|
|
903
|
+
* @stability unstable
|
|
882
904
|
* @category models
|
|
883
905
|
* @since 4.0.0
|
|
884
906
|
*/
|
|
@@ -893,6 +915,7 @@ export type CreateEmbeddingRequest = {
|
|
|
893
915
|
/**
|
|
894
916
|
* Successful response payload returned by the embeddings endpoint.
|
|
895
917
|
*
|
|
918
|
+
* @stability unstable
|
|
896
919
|
* @category models
|
|
897
920
|
* @since 4.0.0
|
|
898
921
|
*/
|
|
@@ -909,6 +932,7 @@ export type CreateEmbeddingResponse = {
|
|
|
909
932
|
/**
|
|
910
933
|
* JSON request body accepted by the embeddings endpoint.
|
|
911
934
|
*
|
|
935
|
+
* @stability unstable
|
|
912
936
|
* @category models
|
|
913
937
|
* @since 4.0.0
|
|
914
938
|
*/
|
|
@@ -916,6 +940,7 @@ export type CreateEmbeddingRequestJson = CreateEmbeddingRequest
|
|
|
916
940
|
/**
|
|
917
941
|
* Decoded successful embeddings response body.
|
|
918
942
|
*
|
|
943
|
+
* @stability unstable
|
|
919
944
|
* @category models
|
|
920
945
|
* @since 4.0.0
|
|
921
946
|
*/
|
|
@@ -923,6 +948,7 @@ export type CreateEmbedding200 = CreateEmbeddingResponse
|
|
|
923
948
|
/**
|
|
924
949
|
* Structured content parts accepted in chat completion messages.
|
|
925
950
|
*
|
|
951
|
+
* @stability unstable
|
|
926
952
|
* @category models
|
|
927
953
|
* @since 4.0.0
|
|
928
954
|
*/
|
|
@@ -941,6 +967,7 @@ export type ChatCompletionContentPart =
|
|
|
941
967
|
/**
|
|
942
968
|
* Tool call data attached to an assistant chat completion message.
|
|
943
969
|
*
|
|
970
|
+
* @stability unstable
|
|
944
971
|
* @category models
|
|
945
972
|
* @since 4.0.0
|
|
946
973
|
*/
|
|
@@ -955,6 +982,7 @@ export type ChatCompletionRequestToolCall = {
|
|
|
955
982
|
/**
|
|
956
983
|
* Message shapes accepted by the chat completions endpoint.
|
|
957
984
|
*
|
|
985
|
+
* @stability unstable
|
|
958
986
|
* @category models
|
|
959
987
|
* @since 4.0.0
|
|
960
988
|
*/
|
|
@@ -972,6 +1000,7 @@ export type ChatCompletionRequestMessage =
|
|
|
972
1000
|
/**
|
|
973
1001
|
* Function tool definition accepted by the chat completions endpoint.
|
|
974
1002
|
*
|
|
1003
|
+
* @stability unstable
|
|
975
1004
|
* @category models
|
|
976
1005
|
* @since 4.0.0
|
|
977
1006
|
*/
|
|
@@ -987,6 +1016,7 @@ export type ChatCompletionTool = {
|
|
|
987
1016
|
/**
|
|
988
1017
|
* Controls whether the model may call tools and can force a specific function.
|
|
989
1018
|
*
|
|
1019
|
+
* @stability unstable
|
|
990
1020
|
* @category configuration
|
|
991
1021
|
* @since 4.0.0
|
|
992
1022
|
*/
|
|
@@ -1003,6 +1033,7 @@ export type ChatCompletionToolChoice =
|
|
|
1003
1033
|
/**
|
|
1004
1034
|
* JSON response format configuration for chat completion requests.
|
|
1005
1035
|
*
|
|
1036
|
+
* @stability unstable
|
|
1006
1037
|
* @category configuration
|
|
1007
1038
|
* @since 4.0.0
|
|
1008
1039
|
*/
|
|
@@ -1022,6 +1053,7 @@ export type ChatCompletionResponseFormat =
|
|
|
1022
1053
|
/**
|
|
1023
1054
|
* Request payload for the OpenAI-compatible chat completions endpoint.
|
|
1024
1055
|
*
|
|
1056
|
+
* @stability unstable
|
|
1025
1057
|
* @category models
|
|
1026
1058
|
* @since 4.0.0
|
|
1027
1059
|
*/
|
|
@@ -1048,6 +1080,7 @@ export type ChatCompletionRequest = {
|
|
|
1048
1080
|
/**
|
|
1049
1081
|
* JSON request body used by this client when creating a chat completion response.
|
|
1050
1082
|
*
|
|
1083
|
+
* @stability unstable
|
|
1051
1084
|
* @category models
|
|
1052
1085
|
* @since 4.0.0
|
|
1053
1086
|
*/
|
|
@@ -1055,6 +1088,7 @@ export type CreateResponseRequestJson = ChatCompletionRequest
|
|
|
1055
1088
|
/**
|
|
1056
1089
|
* Decoded successful chat completion response body returned by `createResponse`.
|
|
1057
1090
|
*
|
|
1091
|
+
* @stability unstable
|
|
1058
1092
|
* @category models
|
|
1059
1093
|
* @since 4.0.0
|
|
1060
1094
|
*/
|
|
@@ -1062,6 +1096,7 @@ export type CreateResponse200 = ChatCompletionResponse
|
|
|
1062
1096
|
/**
|
|
1063
1097
|
* Decoded server-sent event payload emitted by `createResponseStream`.
|
|
1064
1098
|
*
|
|
1099
|
+
* @stability unstable
|
|
1065
1100
|
* @category streaming
|
|
1066
1101
|
* @since 4.0.0
|
|
1067
1102
|
*/
|
|
@@ -1167,6 +1202,7 @@ const ChatCompletionChunk = Schema.Struct({
|
|
|
1167
1202
|
/**
|
|
1168
1203
|
* Decoded tool-call object from a chat completion response or streaming chunk.
|
|
1169
1204
|
*
|
|
1205
|
+
* @stability unstable
|
|
1170
1206
|
* @category models
|
|
1171
1207
|
* @since 4.0.0
|
|
1172
1208
|
*/
|
|
@@ -1174,6 +1210,7 @@ export type ChatCompletionToolCall = typeof ChatCompletionToolCall.Type
|
|
|
1174
1210
|
/**
|
|
1175
1211
|
* Decoded message object from a non-streaming chat completion choice.
|
|
1176
1212
|
*
|
|
1213
|
+
* @stability unstable
|
|
1177
1214
|
* @category models
|
|
1178
1215
|
* @since 4.0.0
|
|
1179
1216
|
*/
|
|
@@ -1181,6 +1218,7 @@ export type ChatCompletionMessage = typeof ChatCompletionMessage.Type
|
|
|
1181
1218
|
/**
|
|
1182
1219
|
* Decoded choice object returned by chat completion responses and chunks.
|
|
1183
1220
|
*
|
|
1221
|
+
* @stability unstable
|
|
1184
1222
|
* @category models
|
|
1185
1223
|
* @since 4.0.0
|
|
1186
1224
|
*/
|
|
@@ -1188,6 +1226,7 @@ export type ChatCompletionChoice = typeof ChatCompletionChoice.Type
|
|
|
1188
1226
|
/**
|
|
1189
1227
|
* Decoded token usage summary returned by chat completions.
|
|
1190
1228
|
*
|
|
1229
|
+
* @stability unstable
|
|
1191
1230
|
* @category models
|
|
1192
1231
|
* @since 4.0.0
|
|
1193
1232
|
*/
|
|
@@ -1195,6 +1234,7 @@ export type ChatCompletionUsage = typeof ChatCompletionUsage.Type
|
|
|
1195
1234
|
/**
|
|
1196
1235
|
* Decoded successful response from the chat completions endpoint.
|
|
1197
1236
|
*
|
|
1237
|
+
* @stability unstable
|
|
1198
1238
|
* @category models
|
|
1199
1239
|
* @since 4.0.0
|
|
1200
1240
|
*/
|
|
@@ -1202,6 +1242,7 @@ export type ChatCompletionResponse = typeof ChatCompletionResponse.Type
|
|
|
1202
1242
|
/**
|
|
1203
1243
|
* Decoded streaming chunk emitted by the chat completions endpoint.
|
|
1204
1244
|
*
|
|
1245
|
+
* @stability unstable
|
|
1205
1246
|
* @category streaming
|
|
1206
1247
|
* @since 4.0.0
|
|
1207
1248
|
*/
|
|
@@ -1209,6 +1250,7 @@ export type ChatCompletionChunk = typeof ChatCompletionChunk.Type
|
|
|
1209
1250
|
/**
|
|
1210
1251
|
* A parsed chat completion event that does not match the expected chunk schema.
|
|
1211
1252
|
*
|
|
1253
|
+
* @stability unstable
|
|
1212
1254
|
* @category streaming
|
|
1213
1255
|
* @since 4.0.0
|
|
1214
1256
|
*/
|
|
@@ -1220,6 +1262,7 @@ export interface UnknownChatCompletionEvent {
|
|
|
1220
1262
|
* Streaming chat completion event, including decoded chunks, unknown parsed
|
|
1221
1263
|
* events, and the `[DONE]` sentinel.
|
|
1222
1264
|
*
|
|
1265
|
+
* @stability unstable
|
|
1223
1266
|
* @category streaming
|
|
1224
1267
|
* @since 4.0.0
|
|
1225
1268
|
*/
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* values, supports scoped request configuration overrides, and checks that the
|
|
6
6
|
* provider returns one numeric vector for each requested input.
|
|
7
7
|
*
|
|
8
|
+
* @stability unstable
|
|
8
9
|
* @since 4.0.0
|
|
9
10
|
*/
|
|
10
11
|
import * as AiError from "effect/ai/AiError"
|
|
@@ -21,6 +22,7 @@ import { OpenAiClient } from "./OpenAiClient.ts"
|
|
|
21
22
|
/**
|
|
22
23
|
* A model identifier accepted by an OpenAI-compatible embeddings endpoint.
|
|
23
24
|
*
|
|
25
|
+
* @stability unstable
|
|
24
26
|
* @category models
|
|
25
27
|
* @since 4.0.0
|
|
26
28
|
*/
|
|
@@ -46,6 +48,7 @@ type ModelConfig = Omit<ConfigOptions, "model"> & { readonly [x: string]: unknow
|
|
|
46
48
|
*
|
|
47
49
|
* @see {@link withConfigOverride} for scoping embedding request overrides
|
|
48
50
|
*
|
|
51
|
+
* @stability unstable
|
|
49
52
|
* @category services
|
|
50
53
|
* @since 4.0.0
|
|
51
54
|
*/
|
|
@@ -65,6 +68,7 @@ export class Config extends Context.Service<
|
|
|
65
68
|
* @see {@link layer} for providing only the embedding model service
|
|
66
69
|
* @see {@link withConfigOverride} for scoped request configuration overrides
|
|
67
70
|
*
|
|
71
|
+
* @stability unstable
|
|
68
72
|
* @category constructors
|
|
69
73
|
* @since 4.0.0
|
|
70
74
|
*/
|
|
@@ -112,6 +116,7 @@ export const model = (
|
|
|
112
116
|
* @see {@link layer} for providing the service as a `Layer`
|
|
113
117
|
* @see {@link withConfigOverride} for scoping embedding request overrides
|
|
114
118
|
*
|
|
119
|
+
* @stability unstable
|
|
115
120
|
* @category constructors
|
|
116
121
|
* @since 4.0.0
|
|
117
122
|
*/
|
|
@@ -146,6 +151,7 @@ export const make = Effect.fnUntraced(function*({ model, config: providerConfig
|
|
|
146
151
|
* @see {@link make} for constructing the embedding model service effectfully
|
|
147
152
|
* @see {@link model} for creating an `AiModel` with configured dimensions
|
|
148
153
|
*
|
|
154
|
+
* @stability unstable
|
|
149
155
|
* @category layers
|
|
150
156
|
* @since 4.0.0
|
|
151
157
|
*/
|
|
@@ -172,6 +178,7 @@ export const layer = (options: {
|
|
|
172
178
|
*
|
|
173
179
|
* @see {@link Config} for available OpenAI-compatible embedding request configuration fields
|
|
174
180
|
*
|
|
181
|
+
* @stability unstable
|
|
175
182
|
* @category configuration
|
|
176
183
|
* @since 4.0.0
|
|
177
184
|
*/
|
|
@@ -193,6 +200,7 @@ export const withConfigOverride: {
|
|
|
193
200
|
*
|
|
194
201
|
* @see {@link Config} for available OpenAI-compatible embedding request configuration fields
|
|
195
202
|
*
|
|
203
|
+
* @stability unstable
|
|
196
204
|
* @category configuration
|
|
197
205
|
* @since 4.0.0
|
|
198
206
|
*/
|
|
@@ -214,6 +222,7 @@ export const withConfigOverride: {
|
|
|
214
222
|
*
|
|
215
223
|
* @see {@link Config} for available OpenAI-compatible embedding request configuration fields
|
|
216
224
|
*
|
|
225
|
+
* @stability unstable
|
|
217
226
|
* @category configuration
|
|
218
227
|
* @since 4.0.0
|
|
219
228
|
*/
|
|
@@ -236,6 +245,7 @@ export const withConfigOverride: {
|
|
|
236
245
|
*
|
|
237
246
|
* @see {@link Config} for available OpenAI-compatible embedding request configuration fields
|
|
238
247
|
*
|
|
248
|
+
* @stability unstable
|
|
239
249
|
* @category configuration
|
|
240
250
|
* @since 4.0.0
|
|
241
251
|
*/
|
|
@@ -257,6 +267,7 @@ export const withConfigOverride: {
|
|
|
257
267
|
*
|
|
258
268
|
* @see {@link Config} for available OpenAI-compatible embedding request configuration fields
|
|
259
269
|
*
|
|
270
|
+
* @stability unstable
|
|
260
271
|
* @category configuration
|
|
261
272
|
* @since 4.0.0
|
|
262
273
|
*/
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* or streaming chat completion results back into Effect AI response content and
|
|
7
7
|
* metadata.
|
|
8
8
|
*
|
|
9
|
+
* @stability unstable
|
|
9
10
|
* @since 4.0.0
|
|
10
11
|
*/
|
|
11
12
|
import * as AiError from "effect/ai/AiError"
|
|
@@ -111,6 +112,7 @@ type ModelConfig = Omit<ConfigOptions, "model"> & { readonly [x: string]: unknow
|
|
|
111
112
|
*
|
|
112
113
|
* @see {@link withConfigOverride} for scoping language model request overrides
|
|
113
114
|
*
|
|
115
|
+
* @stability unstable
|
|
114
116
|
* @category services
|
|
115
117
|
* @since 4.0.0
|
|
116
118
|
*/
|
|
@@ -127,6 +129,7 @@ declare module "effect/ai/Prompt" {
|
|
|
127
129
|
/**
|
|
128
130
|
* OpenAI-compatible options for file prompt parts.
|
|
129
131
|
*
|
|
132
|
+
* @stability unstable
|
|
130
133
|
* @category models
|
|
131
134
|
* @since 4.0.0
|
|
132
135
|
*/
|
|
@@ -145,6 +148,7 @@ declare module "effect/ai/Prompt" {
|
|
|
145
148
|
/**
|
|
146
149
|
* OpenAI-compatible options for reasoning prompt parts.
|
|
147
150
|
*
|
|
151
|
+
* @stability unstable
|
|
148
152
|
* @category models
|
|
149
153
|
* @since 4.0.0
|
|
150
154
|
*/
|
|
@@ -169,6 +173,7 @@ declare module "effect/ai/Prompt" {
|
|
|
169
173
|
/**
|
|
170
174
|
* OpenAI-compatible options for assistant tool-call prompt parts.
|
|
171
175
|
*
|
|
176
|
+
* @stability unstable
|
|
172
177
|
* @category models
|
|
173
178
|
* @since 4.0.0
|
|
174
179
|
*/
|
|
@@ -191,6 +196,7 @@ declare module "effect/ai/Prompt" {
|
|
|
191
196
|
/**
|
|
192
197
|
* OpenAI-compatible options for tool-result prompt parts.
|
|
193
198
|
*
|
|
199
|
+
* @stability unstable
|
|
194
200
|
* @category models
|
|
195
201
|
* @since 4.0.0
|
|
196
202
|
*/
|
|
@@ -213,6 +219,7 @@ declare module "effect/ai/Prompt" {
|
|
|
213
219
|
/**
|
|
214
220
|
* OpenAI-compatible options for text prompt parts.
|
|
215
221
|
*
|
|
222
|
+
* @stability unstable
|
|
216
223
|
* @category models
|
|
217
224
|
* @since 4.0.0
|
|
218
225
|
*/
|
|
@@ -241,6 +248,7 @@ declare module "effect/ai/Response" {
|
|
|
241
248
|
/**
|
|
242
249
|
* OpenAI-compatible metadata attached to a complete text response part.
|
|
243
250
|
*
|
|
251
|
+
* @stability unstable
|
|
244
252
|
* @category models
|
|
245
253
|
* @since 4.0.0
|
|
246
254
|
*/
|
|
@@ -273,6 +281,7 @@ declare module "effect/ai/Response" {
|
|
|
273
281
|
/**
|
|
274
282
|
* OpenAI-compatible metadata emitted when a streamed text part starts.
|
|
275
283
|
*
|
|
284
|
+
* @stability unstable
|
|
276
285
|
* @category models
|
|
277
286
|
* @since 4.0.0
|
|
278
287
|
*/
|
|
@@ -291,6 +300,7 @@ declare module "effect/ai/Response" {
|
|
|
291
300
|
/**
|
|
292
301
|
* OpenAI-compatible metadata emitted when a streamed text part ends.
|
|
293
302
|
*
|
|
303
|
+
* @stability unstable
|
|
294
304
|
* @category models
|
|
295
305
|
* @since 4.0.0
|
|
296
306
|
*/
|
|
@@ -313,6 +323,7 @@ declare module "effect/ai/Response" {
|
|
|
313
323
|
/**
|
|
314
324
|
* OpenAI-compatible metadata attached to a complete reasoning response part.
|
|
315
325
|
*
|
|
326
|
+
* @stability unstable
|
|
316
327
|
* @category models
|
|
317
328
|
* @since 4.0.0
|
|
318
329
|
*/
|
|
@@ -335,6 +346,7 @@ declare module "effect/ai/Response" {
|
|
|
335
346
|
/**
|
|
336
347
|
* OpenAI-compatible metadata emitted when a streamed reasoning part starts.
|
|
337
348
|
*
|
|
349
|
+
* @stability unstable
|
|
338
350
|
* @category models
|
|
339
351
|
* @since 4.0.0
|
|
340
352
|
*/
|
|
@@ -357,6 +369,7 @@ declare module "effect/ai/Response" {
|
|
|
357
369
|
/**
|
|
358
370
|
* OpenAI-compatible metadata emitted for a streamed reasoning delta.
|
|
359
371
|
*
|
|
372
|
+
* @stability unstable
|
|
360
373
|
* @category models
|
|
361
374
|
* @since 4.0.0
|
|
362
375
|
*/
|
|
@@ -375,6 +388,7 @@ declare module "effect/ai/Response" {
|
|
|
375
388
|
/**
|
|
376
389
|
* OpenAI-compatible metadata emitted when a streamed reasoning part ends.
|
|
377
390
|
*
|
|
391
|
+
* @stability unstable
|
|
378
392
|
* @category models
|
|
379
393
|
* @since 4.0.0
|
|
380
394
|
*/
|
|
@@ -397,6 +411,7 @@ declare module "effect/ai/Response" {
|
|
|
397
411
|
/**
|
|
398
412
|
* OpenAI-compatible metadata attached to tool-call response parts.
|
|
399
413
|
*
|
|
414
|
+
* @stability unstable
|
|
400
415
|
* @category models
|
|
401
416
|
* @since 4.0.0
|
|
402
417
|
*/
|
|
@@ -415,6 +430,7 @@ declare module "effect/ai/Response" {
|
|
|
415
430
|
/**
|
|
416
431
|
* OpenAI-compatible metadata attached to document source citations.
|
|
417
432
|
*
|
|
433
|
+
* @stability unstable
|
|
418
434
|
* @category models
|
|
419
435
|
* @since 4.0.0
|
|
420
436
|
*/
|
|
@@ -471,6 +487,7 @@ declare module "effect/ai/Response" {
|
|
|
471
487
|
/**
|
|
472
488
|
* OpenAI-compatible metadata attached to URL source citations.
|
|
473
489
|
*
|
|
490
|
+
* @stability unstable
|
|
474
491
|
* @category models
|
|
475
492
|
* @since 4.0.0
|
|
476
493
|
*/
|
|
@@ -497,6 +514,7 @@ declare module "effect/ai/Response" {
|
|
|
497
514
|
/**
|
|
498
515
|
* OpenAI-compatible metadata attached to finish response parts.
|
|
499
516
|
*
|
|
517
|
+
* @stability unstable
|
|
500
518
|
* @category models
|
|
501
519
|
* @since 4.0.0
|
|
502
520
|
*/
|
|
@@ -528,6 +546,7 @@ declare module "effect/ai/Response" {
|
|
|
528
546
|
* @see {@link layer} for creating a `LanguageModel.LanguageModel` layer directly
|
|
529
547
|
* @see {@link make} for constructing the language model service effectfully
|
|
530
548
|
*
|
|
549
|
+
* @stability unstable
|
|
531
550
|
* @category constructors
|
|
532
551
|
* @since 4.0.0
|
|
533
552
|
*/
|
|
@@ -566,6 +585,7 @@ export const model = (
|
|
|
566
585
|
* @see {@link layer} for providing the service as a `Layer`
|
|
567
586
|
* @see {@link model} for creating a model descriptor for `AiModel.provide`
|
|
568
587
|
*
|
|
588
|
+
* @stability unstable
|
|
569
589
|
* @category constructors
|
|
570
590
|
* @since 4.0.0
|
|
571
591
|
*/
|
|
@@ -675,6 +695,7 @@ export const make = Effect.fnUntraced(function*({ model, config: providerConfig
|
|
|
675
695
|
* @see {@link make} for constructing the language model service effectfully
|
|
676
696
|
* @see {@link model} for creating an AI model descriptor
|
|
677
697
|
*
|
|
698
|
+
* @stability unstable
|
|
678
699
|
* @category layers
|
|
679
700
|
* @since 4.0.0
|
|
680
701
|
*/
|
|
@@ -699,6 +720,7 @@ export const layer = (options: {
|
|
|
699
720
|
*
|
|
700
721
|
* @see {@link Config} for the configuration shape
|
|
701
722
|
*
|
|
723
|
+
* @stability unstable
|
|
702
724
|
* @category configuration
|
|
703
725
|
* @since 4.0.0
|
|
704
726
|
*/
|
|
@@ -718,6 +740,7 @@ export const withConfigOverride: {
|
|
|
718
740
|
*
|
|
719
741
|
* @see {@link Config} for the configuration shape
|
|
720
742
|
*
|
|
743
|
+
* @stability unstable
|
|
721
744
|
* @category configuration
|
|
722
745
|
* @since 4.0.0
|
|
723
746
|
*/
|
|
@@ -737,6 +760,7 @@ export const withConfigOverride: {
|
|
|
737
760
|
*
|
|
738
761
|
* @see {@link Config} for the configuration shape
|
|
739
762
|
*
|
|
763
|
+
* @stability unstable
|
|
740
764
|
* @category configuration
|
|
741
765
|
* @since 4.0.0
|
|
742
766
|
*/
|
|
@@ -757,6 +781,7 @@ export const withConfigOverride: {
|
|
|
757
781
|
*
|
|
758
782
|
* @see {@link Config} for the configuration shape
|
|
759
783
|
*
|
|
784
|
+
* @stability unstable
|
|
760
785
|
* @category configuration
|
|
761
786
|
* @since 4.0.0
|
|
762
787
|
*/
|
|
@@ -776,6 +801,7 @@ export const withConfigOverride: {
|
|
|
776
801
|
*
|
|
777
802
|
* @see {@link Config} for the configuration shape
|
|
778
803
|
*
|
|
804
|
+
* @stability unstable
|
|
779
805
|
* @category configuration
|
|
780
806
|
* @since 4.0.0
|
|
781
807
|
*/
|
package/src/index.ts
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
// @barrel: Auto-generated exports. Do not edit manually.
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
+
* @stability unstable
|
|
8
9
|
* @since 4.0.0
|
|
9
10
|
*/
|
|
10
11
|
export * as OpenAiClient from "./OpenAiClient.ts"
|
|
@@ -15,6 +16,7 @@ export * as OpenAiClient from "./OpenAiClient.ts"
|
|
|
15
16
|
export * as OpenAiConfig from "./OpenAiConfig.ts"
|
|
16
17
|
|
|
17
18
|
/**
|
|
19
|
+
* @stability unstable
|
|
18
20
|
* @since 4.0.0
|
|
19
21
|
*/
|
|
20
22
|
export * as OpenAiEmbeddingModel from "./OpenAiEmbeddingModel.ts"
|
|
@@ -25,6 +27,7 @@ export * as OpenAiEmbeddingModel from "./OpenAiEmbeddingModel.ts"
|
|
|
25
27
|
export * as OpenAiError from "./OpenAiError.ts"
|
|
26
28
|
|
|
27
29
|
/**
|
|
30
|
+
* @stability unstable
|
|
28
31
|
* @since 4.0.0
|
|
29
32
|
*/
|
|
30
33
|
export * as OpenAiLanguageModel from "./OpenAiLanguageModel.ts"
|