supercompat 2.13.0 → 2.15.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/dist/index.cjs +721 -172
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +29 -1
- package/dist/index.d.ts +29 -1
- package/dist/index.js +558 -17
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -389,12 +389,18 @@ __export(src_exports, {
|
|
|
389
389
|
completionsRunAdapter: function() {
|
|
390
390
|
return completionsRunAdapter;
|
|
391
391
|
},
|
|
392
|
+
googleClientAdapter: function() {
|
|
393
|
+
return googleClientAdapter;
|
|
394
|
+
},
|
|
392
395
|
groqClientAdapter: function() {
|
|
393
396
|
return groqClientAdapter;
|
|
394
397
|
},
|
|
395
398
|
mistralClientAdapter: function() {
|
|
396
399
|
return mistralClientAdapter;
|
|
397
400
|
},
|
|
401
|
+
ollamaClientAdapter: function() {
|
|
402
|
+
return ollamaClientAdapter;
|
|
403
|
+
},
|
|
398
404
|
openaiClientAdapter: function() {
|
|
399
405
|
return openaiClientAdapter;
|
|
400
406
|
},
|
|
@@ -1836,70 +1842,676 @@ var serializeMessage2 = function(param) {
|
|
|
1836
1842
|
tool_use_id: message.tool_call_id,
|
|
1837
1843
|
content: message.content
|
|
1838
1844
|
}
|
|
1839
|
-
]
|
|
1845
|
+
]
|
|
1846
|
+
};
|
|
1847
|
+
}
|
|
1848
|
+
};
|
|
1849
|
+
// src/adapters/client/anthropicClientAdapter/completions/serializeMessages/index.ts
|
|
1850
|
+
var serializeMessages = function(param) {
|
|
1851
|
+
var messages3 = param.messages;
|
|
1852
|
+
return messages3.map(function(message) {
|
|
1853
|
+
return serializeMessage2({
|
|
1854
|
+
message: message
|
|
1855
|
+
});
|
|
1856
|
+
});
|
|
1857
|
+
};
|
|
1858
|
+
// src/adapters/client/anthropicClientAdapter/completions/post.ts
|
|
1859
|
+
var post5 = function(param) {
|
|
1860
|
+
var anthropic = param.anthropic;
|
|
1861
|
+
return /*#__PURE__*/ function() {
|
|
1862
|
+
var _ref = _async_to_generator(function(_url, options) {
|
|
1863
|
+
var body, messages3, _ref, systemMessages, otherMessages, system, chatMessages, resultOptions, response, stream, data, error;
|
|
1864
|
+
return _ts_generator(this, function(_state) {
|
|
1865
|
+
switch(_state.label){
|
|
1866
|
+
case 0:
|
|
1867
|
+
body = JSON.parse(options.body);
|
|
1868
|
+
messages3 = body.messages;
|
|
1869
|
+
_ref = _sliced_to_array((0, import_radash3.fork)(messages3, function(message) {
|
|
1870
|
+
return message.role === "system";
|
|
1871
|
+
}), 2), systemMessages = _ref[0], otherMessages = _ref[1];
|
|
1872
|
+
system = systemMessages.map(function(message) {
|
|
1873
|
+
return message.content;
|
|
1874
|
+
}).join("\n");
|
|
1875
|
+
chatMessages = nonEmptyMessages({
|
|
1876
|
+
messages: firstUserMessages({
|
|
1877
|
+
messages: alternatingMessages({
|
|
1878
|
+
messages: otherMessages
|
|
1879
|
+
})
|
|
1880
|
+
})
|
|
1881
|
+
});
|
|
1882
|
+
resultOptions = _object_spread_props(_object_spread({}, (0, import_radash3.omit)(body, [
|
|
1883
|
+
"response_format"
|
|
1884
|
+
])), {
|
|
1885
|
+
stream: body.stream ? (0, import_radash3.isEmpty)(body.tools) : false,
|
|
1886
|
+
system: system,
|
|
1887
|
+
messages: serializeMessages({
|
|
1888
|
+
messages: chatMessages
|
|
1889
|
+
}),
|
|
1890
|
+
max_tokens: 4096,
|
|
1891
|
+
tools: serializeTools({
|
|
1892
|
+
tools: body.tools
|
|
1893
|
+
})
|
|
1894
|
+
});
|
|
1895
|
+
if (!body.stream) return [
|
|
1896
|
+
3,
|
|
1897
|
+
2
|
|
1898
|
+
];
|
|
1899
|
+
return [
|
|
1900
|
+
4,
|
|
1901
|
+
anthropic.messages.stream(resultOptions)
|
|
1902
|
+
];
|
|
1903
|
+
case 1:
|
|
1904
|
+
response = _state.sent();
|
|
1905
|
+
stream = new ReadableStream({
|
|
1906
|
+
start: function start(controller) {
|
|
1907
|
+
return _async_to_generator(function() {
|
|
1908
|
+
var _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, chunk, delta, messageDelta, delta1, messageDelta1, messageDelta2, err;
|
|
1909
|
+
return _ts_generator(this, function(_state) {
|
|
1910
|
+
switch(_state.label){
|
|
1911
|
+
case 0:
|
|
1912
|
+
_iteratorAbruptCompletion = false, _didIteratorError = false;
|
|
1913
|
+
_state.label = 1;
|
|
1914
|
+
case 1:
|
|
1915
|
+
_state.trys.push([
|
|
1916
|
+
1,
|
|
1917
|
+
6,
|
|
1918
|
+
7,
|
|
1919
|
+
12
|
|
1920
|
+
]);
|
|
1921
|
+
_iterator = _async_iterator(response);
|
|
1922
|
+
_state.label = 2;
|
|
1923
|
+
case 2:
|
|
1924
|
+
return [
|
|
1925
|
+
4,
|
|
1926
|
+
_iterator.next()
|
|
1927
|
+
];
|
|
1928
|
+
case 3:
|
|
1929
|
+
if (!(_iteratorAbruptCompletion = !(_step = _state.sent()).done)) return [
|
|
1930
|
+
3,
|
|
1931
|
+
5
|
|
1932
|
+
];
|
|
1933
|
+
_value = _step.value;
|
|
1934
|
+
chunk = _value;
|
|
1935
|
+
if (chunk.type === "content_block_delta") {
|
|
1936
|
+
delta = chunk.delta.type === "input_json_delta" ? {
|
|
1937
|
+
tool_calls: [
|
|
1938
|
+
{
|
|
1939
|
+
index: 0,
|
|
1940
|
+
function: {
|
|
1941
|
+
arguments: chunk.delta.partial_json
|
|
1942
|
+
}
|
|
1943
|
+
}
|
|
1944
|
+
]
|
|
1945
|
+
} : {
|
|
1946
|
+
content: chunk.delta.text
|
|
1947
|
+
};
|
|
1948
|
+
messageDelta = {
|
|
1949
|
+
id: "chatcmpl-".concat((0, import_radash3.uid)(29)),
|
|
1950
|
+
object: "chat.completion.chunk",
|
|
1951
|
+
choices: [
|
|
1952
|
+
{
|
|
1953
|
+
index: chunk.index,
|
|
1954
|
+
delta: delta
|
|
1955
|
+
}
|
|
1956
|
+
]
|
|
1957
|
+
};
|
|
1958
|
+
controller.enqueue("data: ".concat(JSON.stringify(messageDelta), "\n\n"));
|
|
1959
|
+
} else if (chunk.type === "content_block_start") {
|
|
1960
|
+
delta1 = chunk.content_block.type === "tool_use" ? {
|
|
1961
|
+
content: null,
|
|
1962
|
+
tool_calls: [
|
|
1963
|
+
{
|
|
1964
|
+
index: 0,
|
|
1965
|
+
id: chunk.content_block.id,
|
|
1966
|
+
type: "function",
|
|
1967
|
+
function: {
|
|
1968
|
+
name: chunk.content_block.name,
|
|
1969
|
+
arguments: ""
|
|
1970
|
+
}
|
|
1971
|
+
}
|
|
1972
|
+
]
|
|
1973
|
+
} : {
|
|
1974
|
+
content: chunk.content_block.text
|
|
1975
|
+
};
|
|
1976
|
+
messageDelta1 = {
|
|
1977
|
+
id: "chatcmpl-".concat((0, import_radash3.uid)(29)),
|
|
1978
|
+
object: "chat.completion.chunk",
|
|
1979
|
+
choices: [
|
|
1980
|
+
{
|
|
1981
|
+
index: chunk.index,
|
|
1982
|
+
delta: delta1
|
|
1983
|
+
}
|
|
1984
|
+
]
|
|
1985
|
+
};
|
|
1986
|
+
controller.enqueue("data: ".concat(JSON.stringify(messageDelta1), "\n\n"));
|
|
1987
|
+
} else if (chunk.type === "message_start") {
|
|
1988
|
+
messageDelta2 = {
|
|
1989
|
+
id: "chatcmpl-".concat((0, import_radash3.uid)(29)),
|
|
1990
|
+
object: "chat.completion.chunk",
|
|
1991
|
+
choices: [
|
|
1992
|
+
{
|
|
1993
|
+
index: 0,
|
|
1994
|
+
delta: {
|
|
1995
|
+
content: ""
|
|
1996
|
+
}
|
|
1997
|
+
}
|
|
1998
|
+
]
|
|
1999
|
+
};
|
|
2000
|
+
controller.enqueue("data: ".concat(JSON.stringify(messageDelta2), "\n\n"));
|
|
2001
|
+
}
|
|
2002
|
+
_state.label = 4;
|
|
2003
|
+
case 4:
|
|
2004
|
+
_iteratorAbruptCompletion = false;
|
|
2005
|
+
return [
|
|
2006
|
+
3,
|
|
2007
|
+
2
|
|
2008
|
+
];
|
|
2009
|
+
case 5:
|
|
2010
|
+
return [
|
|
2011
|
+
3,
|
|
2012
|
+
12
|
|
2013
|
+
];
|
|
2014
|
+
case 6:
|
|
2015
|
+
err = _state.sent();
|
|
2016
|
+
_didIteratorError = true;
|
|
2017
|
+
_iteratorError = err;
|
|
2018
|
+
return [
|
|
2019
|
+
3,
|
|
2020
|
+
12
|
|
2021
|
+
];
|
|
2022
|
+
case 7:
|
|
2023
|
+
_state.trys.push([
|
|
2024
|
+
7,
|
|
2025
|
+
,
|
|
2026
|
+
10,
|
|
2027
|
+
11
|
|
2028
|
+
]);
|
|
2029
|
+
if (!(_iteratorAbruptCompletion && _iterator.return != null)) return [
|
|
2030
|
+
3,
|
|
2031
|
+
9
|
|
2032
|
+
];
|
|
2033
|
+
return [
|
|
2034
|
+
4,
|
|
2035
|
+
_iterator.return()
|
|
2036
|
+
];
|
|
2037
|
+
case 8:
|
|
2038
|
+
_state.sent();
|
|
2039
|
+
_state.label = 9;
|
|
2040
|
+
case 9:
|
|
2041
|
+
return [
|
|
2042
|
+
3,
|
|
2043
|
+
11
|
|
2044
|
+
];
|
|
2045
|
+
case 10:
|
|
2046
|
+
if (_didIteratorError) {
|
|
2047
|
+
throw _iteratorError;
|
|
2048
|
+
}
|
|
2049
|
+
return [
|
|
2050
|
+
7
|
|
2051
|
+
];
|
|
2052
|
+
case 11:
|
|
2053
|
+
return [
|
|
2054
|
+
7
|
|
2055
|
+
];
|
|
2056
|
+
case 12:
|
|
2057
|
+
controller.close();
|
|
2058
|
+
return [
|
|
2059
|
+
2
|
|
2060
|
+
];
|
|
2061
|
+
}
|
|
2062
|
+
});
|
|
2063
|
+
})();
|
|
2064
|
+
}
|
|
2065
|
+
});
|
|
2066
|
+
return [
|
|
2067
|
+
2,
|
|
2068
|
+
new Response(stream, {
|
|
2069
|
+
headers: {
|
|
2070
|
+
"Content-Type": "text/event-stream"
|
|
2071
|
+
}
|
|
2072
|
+
})
|
|
2073
|
+
];
|
|
2074
|
+
case 2:
|
|
2075
|
+
_state.trys.push([
|
|
2076
|
+
2,
|
|
2077
|
+
4,
|
|
2078
|
+
,
|
|
2079
|
+
5
|
|
2080
|
+
]);
|
|
2081
|
+
return [
|
|
2082
|
+
4,
|
|
2083
|
+
anthropic.messages.create(resultOptions)
|
|
2084
|
+
];
|
|
2085
|
+
case 3:
|
|
2086
|
+
data = _state.sent();
|
|
2087
|
+
return [
|
|
2088
|
+
2,
|
|
2089
|
+
new Response(JSON.stringify({
|
|
2090
|
+
data: data
|
|
2091
|
+
}), {
|
|
2092
|
+
status: 200,
|
|
2093
|
+
headers: {
|
|
2094
|
+
"Content-Type": "application/json"
|
|
2095
|
+
}
|
|
2096
|
+
})
|
|
2097
|
+
];
|
|
2098
|
+
case 4:
|
|
2099
|
+
error = _state.sent();
|
|
2100
|
+
return [
|
|
2101
|
+
2,
|
|
2102
|
+
new Response(JSON.stringify({
|
|
2103
|
+
error: error
|
|
2104
|
+
}), {
|
|
2105
|
+
status: 500,
|
|
2106
|
+
headers: {
|
|
2107
|
+
"Content-Type": "application/json"
|
|
2108
|
+
}
|
|
2109
|
+
})
|
|
2110
|
+
];
|
|
2111
|
+
case 5:
|
|
2112
|
+
return [
|
|
2113
|
+
2
|
|
2114
|
+
];
|
|
2115
|
+
}
|
|
2116
|
+
});
|
|
2117
|
+
});
|
|
2118
|
+
return function(_url, options) {
|
|
2119
|
+
return _ref.apply(this, arguments);
|
|
2120
|
+
};
|
|
2121
|
+
}();
|
|
2122
|
+
};
|
|
2123
|
+
// src/adapters/client/anthropicClientAdapter/completions/index.ts
|
|
2124
|
+
var completions5 = function(param) {
|
|
2125
|
+
var anthropic = param.anthropic;
|
|
2126
|
+
return {
|
|
2127
|
+
post: post5({
|
|
2128
|
+
anthropic: anthropic
|
|
2129
|
+
})
|
|
2130
|
+
};
|
|
2131
|
+
};
|
|
2132
|
+
// src/adapters/client/anthropicClientAdapter/index.ts
|
|
2133
|
+
var anthropicClientAdapter = function(param) {
|
|
2134
|
+
var anthropic = param.anthropic;
|
|
2135
|
+
return {
|
|
2136
|
+
client: anthropic,
|
|
2137
|
+
requestHandlers: {
|
|
2138
|
+
"^/v1/models$": models7({
|
|
2139
|
+
anthropic: anthropic
|
|
2140
|
+
}),
|
|
2141
|
+
"^/v1/chat/completions$": completions5({
|
|
2142
|
+
anthropic: anthropic
|
|
2143
|
+
})
|
|
2144
|
+
}
|
|
2145
|
+
};
|
|
2146
|
+
};
|
|
2147
|
+
// src/adapters/client/togetherClientAdapter/models/get.ts
|
|
2148
|
+
var get6 = function(param) {
|
|
2149
|
+
var together = param.together;
|
|
2150
|
+
return /*#__PURE__*/ function() {
|
|
2151
|
+
var _ref = _async_to_generator(function(_url, _options) {
|
|
2152
|
+
var data, error;
|
|
2153
|
+
return _ts_generator(this, function(_state) {
|
|
2154
|
+
switch(_state.label){
|
|
2155
|
+
case 0:
|
|
2156
|
+
_state.trys.push([
|
|
2157
|
+
0,
|
|
2158
|
+
2,
|
|
2159
|
+
,
|
|
2160
|
+
3
|
|
2161
|
+
]);
|
|
2162
|
+
return [
|
|
2163
|
+
4,
|
|
2164
|
+
together.models.list()
|
|
2165
|
+
];
|
|
2166
|
+
case 1:
|
|
2167
|
+
data = _state.sent();
|
|
2168
|
+
return [
|
|
2169
|
+
2,
|
|
2170
|
+
new Response(JSON.stringify({
|
|
2171
|
+
type: "list",
|
|
2172
|
+
// @ts-ignore-next-line
|
|
2173
|
+
data: data.body
|
|
2174
|
+
}), {
|
|
2175
|
+
status: 200,
|
|
2176
|
+
headers: {
|
|
2177
|
+
"Content-Type": "application/json"
|
|
2178
|
+
}
|
|
2179
|
+
})
|
|
2180
|
+
];
|
|
2181
|
+
case 2:
|
|
2182
|
+
error = _state.sent();
|
|
2183
|
+
return [
|
|
2184
|
+
2,
|
|
2185
|
+
new Response(JSON.stringify({
|
|
2186
|
+
error: error
|
|
2187
|
+
}), {
|
|
2188
|
+
status: 500,
|
|
2189
|
+
headers: {
|
|
2190
|
+
"Content-Type": "application/json"
|
|
2191
|
+
}
|
|
2192
|
+
})
|
|
2193
|
+
];
|
|
2194
|
+
case 3:
|
|
2195
|
+
return [
|
|
2196
|
+
2
|
|
2197
|
+
];
|
|
2198
|
+
}
|
|
2199
|
+
});
|
|
2200
|
+
});
|
|
2201
|
+
return function(_url, _options) {
|
|
2202
|
+
return _ref.apply(this, arguments);
|
|
2203
|
+
};
|
|
2204
|
+
}();
|
|
2205
|
+
};
|
|
2206
|
+
// src/adapters/client/togetherClientAdapter/models/index.ts
|
|
2207
|
+
var models8 = function(param) {
|
|
2208
|
+
var together = param.together;
|
|
2209
|
+
return {
|
|
2210
|
+
get: get6({
|
|
2211
|
+
together: together
|
|
2212
|
+
})
|
|
2213
|
+
};
|
|
2214
|
+
};
|
|
2215
|
+
// src/adapters/client/togetherClientAdapter/completions/post.ts
|
|
2216
|
+
var post6 = function(param) {
|
|
2217
|
+
var together = param.together;
|
|
2218
|
+
return /*#__PURE__*/ function() {
|
|
2219
|
+
var _ref = _async_to_generator(function(_url, options) {
|
|
2220
|
+
var body, response, stream, data, error;
|
|
2221
|
+
return _ts_generator(this, function(_state) {
|
|
2222
|
+
switch(_state.label){
|
|
2223
|
+
case 0:
|
|
2224
|
+
body = JSON.parse(options.body);
|
|
2225
|
+
if (!body.stream) return [
|
|
2226
|
+
3,
|
|
2227
|
+
2
|
|
2228
|
+
];
|
|
2229
|
+
return [
|
|
2230
|
+
4,
|
|
2231
|
+
together.chat.completions.create(body)
|
|
2232
|
+
];
|
|
2233
|
+
case 1:
|
|
2234
|
+
response = _state.sent();
|
|
2235
|
+
console.dir({
|
|
2236
|
+
response: response
|
|
2237
|
+
}, {
|
|
2238
|
+
depth: null
|
|
2239
|
+
});
|
|
2240
|
+
stream = new ReadableStream({
|
|
2241
|
+
start: function start(controller) {
|
|
2242
|
+
return _async_to_generator(function() {
|
|
2243
|
+
var _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, chunk, err;
|
|
2244
|
+
return _ts_generator(this, function(_state) {
|
|
2245
|
+
switch(_state.label){
|
|
2246
|
+
case 0:
|
|
2247
|
+
_iteratorAbruptCompletion = false, _didIteratorError = false;
|
|
2248
|
+
_state.label = 1;
|
|
2249
|
+
case 1:
|
|
2250
|
+
_state.trys.push([
|
|
2251
|
+
1,
|
|
2252
|
+
6,
|
|
2253
|
+
7,
|
|
2254
|
+
12
|
|
2255
|
+
]);
|
|
2256
|
+
_iterator = _async_iterator(response);
|
|
2257
|
+
_state.label = 2;
|
|
2258
|
+
case 2:
|
|
2259
|
+
return [
|
|
2260
|
+
4,
|
|
2261
|
+
_iterator.next()
|
|
2262
|
+
];
|
|
2263
|
+
case 3:
|
|
2264
|
+
if (!(_iteratorAbruptCompletion = !(_step = _state.sent()).done)) return [
|
|
2265
|
+
3,
|
|
2266
|
+
5
|
|
2267
|
+
];
|
|
2268
|
+
_value = _step.value;
|
|
2269
|
+
chunk = _value;
|
|
2270
|
+
controller.enqueue("data: ".concat(JSON.stringify(chunk), "\n\n"));
|
|
2271
|
+
_state.label = 4;
|
|
2272
|
+
case 4:
|
|
2273
|
+
_iteratorAbruptCompletion = false;
|
|
2274
|
+
return [
|
|
2275
|
+
3,
|
|
2276
|
+
2
|
|
2277
|
+
];
|
|
2278
|
+
case 5:
|
|
2279
|
+
return [
|
|
2280
|
+
3,
|
|
2281
|
+
12
|
|
2282
|
+
];
|
|
2283
|
+
case 6:
|
|
2284
|
+
err = _state.sent();
|
|
2285
|
+
_didIteratorError = true;
|
|
2286
|
+
_iteratorError = err;
|
|
2287
|
+
return [
|
|
2288
|
+
3,
|
|
2289
|
+
12
|
|
2290
|
+
];
|
|
2291
|
+
case 7:
|
|
2292
|
+
_state.trys.push([
|
|
2293
|
+
7,
|
|
2294
|
+
,
|
|
2295
|
+
10,
|
|
2296
|
+
11
|
|
2297
|
+
]);
|
|
2298
|
+
if (!(_iteratorAbruptCompletion && _iterator.return != null)) return [
|
|
2299
|
+
3,
|
|
2300
|
+
9
|
|
2301
|
+
];
|
|
2302
|
+
return [
|
|
2303
|
+
4,
|
|
2304
|
+
_iterator.return()
|
|
2305
|
+
];
|
|
2306
|
+
case 8:
|
|
2307
|
+
_state.sent();
|
|
2308
|
+
_state.label = 9;
|
|
2309
|
+
case 9:
|
|
2310
|
+
return [
|
|
2311
|
+
3,
|
|
2312
|
+
11
|
|
2313
|
+
];
|
|
2314
|
+
case 10:
|
|
2315
|
+
if (_didIteratorError) {
|
|
2316
|
+
throw _iteratorError;
|
|
2317
|
+
}
|
|
2318
|
+
return [
|
|
2319
|
+
7
|
|
2320
|
+
];
|
|
2321
|
+
case 11:
|
|
2322
|
+
return [
|
|
2323
|
+
7
|
|
2324
|
+
];
|
|
2325
|
+
case 12:
|
|
2326
|
+
controller.close();
|
|
2327
|
+
return [
|
|
2328
|
+
2
|
|
2329
|
+
];
|
|
2330
|
+
}
|
|
2331
|
+
});
|
|
2332
|
+
})();
|
|
2333
|
+
}
|
|
2334
|
+
});
|
|
2335
|
+
return [
|
|
2336
|
+
2,
|
|
2337
|
+
new Response(stream, {
|
|
2338
|
+
headers: {
|
|
2339
|
+
"Content-Type": "text/event-stream"
|
|
2340
|
+
}
|
|
2341
|
+
})
|
|
2342
|
+
];
|
|
2343
|
+
case 2:
|
|
2344
|
+
_state.trys.push([
|
|
2345
|
+
2,
|
|
2346
|
+
4,
|
|
2347
|
+
,
|
|
2348
|
+
5
|
|
2349
|
+
]);
|
|
2350
|
+
return [
|
|
2351
|
+
4,
|
|
2352
|
+
together.chat.completions.create(body)
|
|
2353
|
+
];
|
|
2354
|
+
case 3:
|
|
2355
|
+
data = _state.sent();
|
|
2356
|
+
console.dir({
|
|
2357
|
+
data: data
|
|
2358
|
+
}, {
|
|
2359
|
+
depth: null
|
|
2360
|
+
});
|
|
2361
|
+
return [
|
|
2362
|
+
2,
|
|
2363
|
+
new Response(JSON.stringify({
|
|
2364
|
+
data: data
|
|
2365
|
+
}), {
|
|
2366
|
+
status: 200,
|
|
2367
|
+
headers: {
|
|
2368
|
+
"Content-Type": "application/json"
|
|
2369
|
+
}
|
|
2370
|
+
})
|
|
2371
|
+
];
|
|
2372
|
+
case 4:
|
|
2373
|
+
error = _state.sent();
|
|
2374
|
+
return [
|
|
2375
|
+
2,
|
|
2376
|
+
new Response(JSON.stringify({
|
|
2377
|
+
error: error
|
|
2378
|
+
}), {
|
|
2379
|
+
status: 500,
|
|
2380
|
+
headers: {
|
|
2381
|
+
"Content-Type": "application/json"
|
|
2382
|
+
}
|
|
2383
|
+
})
|
|
2384
|
+
];
|
|
2385
|
+
case 5:
|
|
2386
|
+
return [
|
|
2387
|
+
2
|
|
2388
|
+
];
|
|
2389
|
+
}
|
|
2390
|
+
});
|
|
2391
|
+
});
|
|
2392
|
+
return function(_url, options) {
|
|
2393
|
+
return _ref.apply(this, arguments);
|
|
2394
|
+
};
|
|
2395
|
+
}();
|
|
2396
|
+
};
|
|
2397
|
+
// src/adapters/client/togetherClientAdapter/completions/index.ts
|
|
2398
|
+
var completions6 = function(param) {
|
|
2399
|
+
var together = param.together;
|
|
2400
|
+
return {
|
|
2401
|
+
post: post6({
|
|
2402
|
+
together: together
|
|
2403
|
+
})
|
|
2404
|
+
};
|
|
2405
|
+
};
|
|
2406
|
+
// src/adapters/client/togetherClientAdapter/index.ts
|
|
2407
|
+
var togetherClientAdapter = function(param) {
|
|
2408
|
+
var together = param.together;
|
|
2409
|
+
return {
|
|
2410
|
+
client: together,
|
|
2411
|
+
requestHandlers: {
|
|
2412
|
+
"^/v1/models$": models8({
|
|
2413
|
+
together: together
|
|
2414
|
+
}),
|
|
2415
|
+
"^/(?:v1|/?openai)/chat/completions$": completions6({
|
|
2416
|
+
together: together
|
|
2417
|
+
})
|
|
2418
|
+
}
|
|
2419
|
+
};
|
|
2420
|
+
};
|
|
2421
|
+
// src/adapters/client/googleClientAdapter/models/get.ts
|
|
2422
|
+
var models9 = [
|
|
2423
|
+
"gemini-2.0-flash-exp",
|
|
2424
|
+
"gemini-1.5-flash",
|
|
2425
|
+
"gemini-1.5-flash-8b",
|
|
2426
|
+
"gemini-1.5-pro",
|
|
2427
|
+
"gemini-1.0-pro",
|
|
2428
|
+
"text-embedding-004",
|
|
2429
|
+
"aqa"
|
|
2430
|
+
];
|
|
2431
|
+
var get7 = function(param) {
|
|
2432
|
+
var google = param.google;
|
|
2433
|
+
return /*#__PURE__*/ function() {
|
|
2434
|
+
var _ref = _async_to_generator(function(_url, _options) {
|
|
2435
|
+
return _ts_generator(this, function(_state) {
|
|
2436
|
+
try {
|
|
2437
|
+
return [
|
|
2438
|
+
2,
|
|
2439
|
+
new Response(JSON.stringify({
|
|
2440
|
+
type: "list",
|
|
2441
|
+
data: models9.map(function(model) {
|
|
2442
|
+
return {
|
|
2443
|
+
id: model,
|
|
2444
|
+
object: "model"
|
|
2445
|
+
};
|
|
2446
|
+
})
|
|
2447
|
+
}), {
|
|
2448
|
+
status: 200,
|
|
2449
|
+
headers: {
|
|
2450
|
+
"Content-Type": "application/json"
|
|
2451
|
+
}
|
|
2452
|
+
})
|
|
2453
|
+
];
|
|
2454
|
+
} catch (error) {
|
|
2455
|
+
return [
|
|
2456
|
+
2,
|
|
2457
|
+
new Response(JSON.stringify({
|
|
2458
|
+
error: error
|
|
2459
|
+
}), {
|
|
2460
|
+
status: 500,
|
|
2461
|
+
headers: {
|
|
2462
|
+
"Content-Type": "application/json"
|
|
2463
|
+
}
|
|
2464
|
+
})
|
|
2465
|
+
];
|
|
2466
|
+
}
|
|
2467
|
+
return [
|
|
2468
|
+
2
|
|
2469
|
+
];
|
|
2470
|
+
});
|
|
2471
|
+
});
|
|
2472
|
+
return function(_url, _options) {
|
|
2473
|
+
return _ref.apply(this, arguments);
|
|
1840
2474
|
};
|
|
1841
|
-
}
|
|
2475
|
+
}();
|
|
1842
2476
|
};
|
|
1843
|
-
// src/adapters/client/
|
|
1844
|
-
var
|
|
1845
|
-
var
|
|
1846
|
-
return
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
})
|
|
1850
|
-
}
|
|
2477
|
+
// src/adapters/client/googleClientAdapter/models/index.ts
|
|
2478
|
+
var models10 = function(param) {
|
|
2479
|
+
var google = param.google;
|
|
2480
|
+
return {
|
|
2481
|
+
get: get7({
|
|
2482
|
+
google: google
|
|
2483
|
+
})
|
|
2484
|
+
};
|
|
1851
2485
|
};
|
|
1852
|
-
// src/adapters/client/
|
|
1853
|
-
var
|
|
1854
|
-
var
|
|
2486
|
+
// src/adapters/client/googleClientAdapter/completions/post.ts
|
|
2487
|
+
var post7 = function(param) {
|
|
2488
|
+
var google = param.google;
|
|
1855
2489
|
return /*#__PURE__*/ function() {
|
|
1856
2490
|
var _ref = _async_to_generator(function(_url, options) {
|
|
1857
|
-
var body,
|
|
2491
|
+
var body, response, stream, data, error;
|
|
1858
2492
|
return _ts_generator(this, function(_state) {
|
|
1859
2493
|
switch(_state.label){
|
|
1860
2494
|
case 0:
|
|
1861
2495
|
body = JSON.parse(options.body);
|
|
1862
|
-
messages3 = body.messages;
|
|
1863
|
-
_ref = _sliced_to_array((0, import_radash3.fork)(messages3, function(message) {
|
|
1864
|
-
return message.role === "system";
|
|
1865
|
-
}), 2), systemMessages = _ref[0], otherMessages = _ref[1];
|
|
1866
|
-
system = systemMessages.map(function(message) {
|
|
1867
|
-
return message.content;
|
|
1868
|
-
}).join("\n");
|
|
1869
|
-
chatMessages = nonEmptyMessages({
|
|
1870
|
-
messages: firstUserMessages({
|
|
1871
|
-
messages: alternatingMessages({
|
|
1872
|
-
messages: otherMessages
|
|
1873
|
-
})
|
|
1874
|
-
})
|
|
1875
|
-
});
|
|
1876
|
-
resultOptions = _object_spread_props(_object_spread({}, (0, import_radash3.omit)(body, [
|
|
1877
|
-
"response_format"
|
|
1878
|
-
])), {
|
|
1879
|
-
stream: body.stream ? (0, import_radash3.isEmpty)(body.tools) : false,
|
|
1880
|
-
system: system,
|
|
1881
|
-
messages: serializeMessages({
|
|
1882
|
-
messages: chatMessages
|
|
1883
|
-
}),
|
|
1884
|
-
max_tokens: 4096,
|
|
1885
|
-
tools: serializeTools({
|
|
1886
|
-
tools: body.tools
|
|
1887
|
-
})
|
|
1888
|
-
});
|
|
1889
2496
|
if (!body.stream) return [
|
|
1890
2497
|
3,
|
|
1891
2498
|
2
|
|
1892
2499
|
];
|
|
1893
2500
|
return [
|
|
1894
2501
|
4,
|
|
1895
|
-
|
|
2502
|
+
google.chat.completions.create(body)
|
|
1896
2503
|
];
|
|
1897
2504
|
case 1:
|
|
1898
2505
|
response = _state.sent();
|
|
2506
|
+
console.dir({
|
|
2507
|
+
response: response
|
|
2508
|
+
}, {
|
|
2509
|
+
depth: null
|
|
2510
|
+
});
|
|
1899
2511
|
stream = new ReadableStream({
|
|
1900
2512
|
start: function start(controller) {
|
|
1901
2513
|
return _async_to_generator(function() {
|
|
1902
|
-
var _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, chunk,
|
|
2514
|
+
var _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, chunk, err;
|
|
1903
2515
|
return _ts_generator(this, function(_state) {
|
|
1904
2516
|
switch(_state.label){
|
|
1905
2517
|
case 0:
|
|
@@ -1926,73 +2538,7 @@ var post5 = function(param) {
|
|
|
1926
2538
|
];
|
|
1927
2539
|
_value = _step.value;
|
|
1928
2540
|
chunk = _value;
|
|
1929
|
-
|
|
1930
|
-
delta = chunk.delta.type === "input_json_delta" ? {
|
|
1931
|
-
tool_calls: [
|
|
1932
|
-
{
|
|
1933
|
-
index: 0,
|
|
1934
|
-
function: {
|
|
1935
|
-
arguments: chunk.delta.partial_json
|
|
1936
|
-
}
|
|
1937
|
-
}
|
|
1938
|
-
]
|
|
1939
|
-
} : {
|
|
1940
|
-
content: chunk.delta.text
|
|
1941
|
-
};
|
|
1942
|
-
messageDelta = {
|
|
1943
|
-
id: "chatcmpl-".concat((0, import_radash3.uid)(29)),
|
|
1944
|
-
object: "chat.completion.chunk",
|
|
1945
|
-
choices: [
|
|
1946
|
-
{
|
|
1947
|
-
index: chunk.index,
|
|
1948
|
-
delta: delta
|
|
1949
|
-
}
|
|
1950
|
-
]
|
|
1951
|
-
};
|
|
1952
|
-
controller.enqueue("data: ".concat(JSON.stringify(messageDelta), "\n\n"));
|
|
1953
|
-
} else if (chunk.type === "content_block_start") {
|
|
1954
|
-
delta1 = chunk.content_block.type === "tool_use" ? {
|
|
1955
|
-
content: null,
|
|
1956
|
-
tool_calls: [
|
|
1957
|
-
{
|
|
1958
|
-
index: 0,
|
|
1959
|
-
id: chunk.content_block.id,
|
|
1960
|
-
type: "function",
|
|
1961
|
-
function: {
|
|
1962
|
-
name: chunk.content_block.name,
|
|
1963
|
-
arguments: ""
|
|
1964
|
-
}
|
|
1965
|
-
}
|
|
1966
|
-
]
|
|
1967
|
-
} : {
|
|
1968
|
-
content: chunk.content_block.text
|
|
1969
|
-
};
|
|
1970
|
-
messageDelta1 = {
|
|
1971
|
-
id: "chatcmpl-".concat((0, import_radash3.uid)(29)),
|
|
1972
|
-
object: "chat.completion.chunk",
|
|
1973
|
-
choices: [
|
|
1974
|
-
{
|
|
1975
|
-
index: chunk.index,
|
|
1976
|
-
delta: delta1
|
|
1977
|
-
}
|
|
1978
|
-
]
|
|
1979
|
-
};
|
|
1980
|
-
controller.enqueue("data: ".concat(JSON.stringify(messageDelta1), "\n\n"));
|
|
1981
|
-
} else if (chunk.type === "message_start") {
|
|
1982
|
-
messageDelta2 = {
|
|
1983
|
-
id: "chatcmpl-".concat((0, import_radash3.uid)(29)),
|
|
1984
|
-
object: "chat.completion.chunk",
|
|
1985
|
-
choices: [
|
|
1986
|
-
{
|
|
1987
|
-
index: 0,
|
|
1988
|
-
delta: {
|
|
1989
|
-
content: ""
|
|
1990
|
-
}
|
|
1991
|
-
}
|
|
1992
|
-
]
|
|
1993
|
-
};
|
|
1994
|
-
controller.enqueue("data: ".concat(JSON.stringify(messageDelta2), "\n\n"));
|
|
1995
|
-
}
|
|
2541
|
+
controller.enqueue("data: ".concat(JSON.stringify(chunk), "\n\n"));
|
|
1996
2542
|
_state.label = 4;
|
|
1997
2543
|
case 4:
|
|
1998
2544
|
_iteratorAbruptCompletion = false;
|
|
@@ -2074,10 +2620,15 @@ var post5 = function(param) {
|
|
|
2074
2620
|
]);
|
|
2075
2621
|
return [
|
|
2076
2622
|
4,
|
|
2077
|
-
|
|
2623
|
+
google.chat.completions.create(body)
|
|
2078
2624
|
];
|
|
2079
2625
|
case 3:
|
|
2080
2626
|
data = _state.sent();
|
|
2627
|
+
console.dir({
|
|
2628
|
+
data: data
|
|
2629
|
+
}, {
|
|
2630
|
+
depth: null
|
|
2631
|
+
});
|
|
2081
2632
|
return [
|
|
2082
2633
|
2,
|
|
2083
2634
|
new Response(JSON.stringify({
|
|
@@ -2114,33 +2665,33 @@ var post5 = function(param) {
|
|
|
2114
2665
|
};
|
|
2115
2666
|
}();
|
|
2116
2667
|
};
|
|
2117
|
-
// src/adapters/client/
|
|
2118
|
-
var
|
|
2119
|
-
var
|
|
2668
|
+
// src/adapters/client/googleClientAdapter/completions/index.ts
|
|
2669
|
+
var completions7 = function(param) {
|
|
2670
|
+
var google = param.google;
|
|
2120
2671
|
return {
|
|
2121
|
-
post:
|
|
2122
|
-
|
|
2672
|
+
post: post7({
|
|
2673
|
+
google: google
|
|
2123
2674
|
})
|
|
2124
2675
|
};
|
|
2125
2676
|
};
|
|
2126
|
-
// src/adapters/client/
|
|
2127
|
-
var
|
|
2128
|
-
var
|
|
2677
|
+
// src/adapters/client/googleClientAdapter/index.ts
|
|
2678
|
+
var googleClientAdapter = function(param) {
|
|
2679
|
+
var google = param.google;
|
|
2129
2680
|
return {
|
|
2130
|
-
client:
|
|
2681
|
+
client: google,
|
|
2131
2682
|
requestHandlers: {
|
|
2132
|
-
"^/v1/models$":
|
|
2133
|
-
|
|
2683
|
+
"^/v1/models$": models10({
|
|
2684
|
+
google: google
|
|
2134
2685
|
}),
|
|
2135
|
-
"^/v1/chat/completions$":
|
|
2136
|
-
|
|
2686
|
+
"^/(?:v1|/?openai)/chat/completions$": completions7({
|
|
2687
|
+
google: google
|
|
2137
2688
|
})
|
|
2138
2689
|
}
|
|
2139
2690
|
};
|
|
2140
2691
|
};
|
|
2141
|
-
// src/adapters/client/
|
|
2142
|
-
var
|
|
2143
|
-
var
|
|
2692
|
+
// src/adapters/client/ollamaClientAdapter/models/get.ts
|
|
2693
|
+
var get8 = function(param) {
|
|
2694
|
+
var ollama = param.ollama;
|
|
2144
2695
|
return /*#__PURE__*/ function() {
|
|
2145
2696
|
var _ref = _async_to_generator(function(_url, _options) {
|
|
2146
2697
|
var data, error;
|
|
@@ -2155,17 +2706,13 @@ var get6 = function(param) {
|
|
|
2155
2706
|
]);
|
|
2156
2707
|
return [
|
|
2157
2708
|
4,
|
|
2158
|
-
|
|
2709
|
+
ollama.models.list()
|
|
2159
2710
|
];
|
|
2160
2711
|
case 1:
|
|
2161
2712
|
data = _state.sent();
|
|
2162
2713
|
return [
|
|
2163
2714
|
2,
|
|
2164
|
-
new Response(JSON.stringify({
|
|
2165
|
-
type: "list",
|
|
2166
|
-
// @ts-ignore-next-line
|
|
2167
|
-
data: data.body
|
|
2168
|
-
}), {
|
|
2715
|
+
new Response(JSON.stringify(data), {
|
|
2169
2716
|
status: 200,
|
|
2170
2717
|
headers: {
|
|
2171
2718
|
"Content-Type": "application/json"
|
|
@@ -2197,18 +2744,18 @@ var get6 = function(param) {
|
|
|
2197
2744
|
};
|
|
2198
2745
|
}();
|
|
2199
2746
|
};
|
|
2200
|
-
// src/adapters/client/
|
|
2201
|
-
var
|
|
2202
|
-
var
|
|
2747
|
+
// src/adapters/client/ollamaClientAdapter/models/index.ts
|
|
2748
|
+
var models11 = function(param) {
|
|
2749
|
+
var ollama = param.ollama;
|
|
2203
2750
|
return {
|
|
2204
|
-
get:
|
|
2205
|
-
|
|
2751
|
+
get: get8({
|
|
2752
|
+
ollama: ollama
|
|
2206
2753
|
})
|
|
2207
2754
|
};
|
|
2208
2755
|
};
|
|
2209
|
-
// src/adapters/client/
|
|
2210
|
-
var
|
|
2211
|
-
var
|
|
2756
|
+
// src/adapters/client/ollamaClientAdapter/completions/post.ts
|
|
2757
|
+
var post8 = function(param) {
|
|
2758
|
+
var ollama = param.ollama;
|
|
2212
2759
|
return /*#__PURE__*/ function() {
|
|
2213
2760
|
var _ref = _async_to_generator(function(_url, options) {
|
|
2214
2761
|
var body, response, stream, data, error;
|
|
@@ -2222,7 +2769,7 @@ var post6 = function(param) {
|
|
|
2222
2769
|
];
|
|
2223
2770
|
return [
|
|
2224
2771
|
4,
|
|
2225
|
-
|
|
2772
|
+
ollama.chat.completions.create(body)
|
|
2226
2773
|
];
|
|
2227
2774
|
case 1:
|
|
2228
2775
|
response = _state.sent();
|
|
@@ -2343,7 +2890,7 @@ var post6 = function(param) {
|
|
|
2343
2890
|
]);
|
|
2344
2891
|
return [
|
|
2345
2892
|
4,
|
|
2346
|
-
|
|
2893
|
+
ollama.chat.completions.create(body)
|
|
2347
2894
|
];
|
|
2348
2895
|
case 3:
|
|
2349
2896
|
data = _state.sent();
|
|
@@ -2388,26 +2935,26 @@ var post6 = function(param) {
|
|
|
2388
2935
|
};
|
|
2389
2936
|
}();
|
|
2390
2937
|
};
|
|
2391
|
-
// src/adapters/client/
|
|
2392
|
-
var
|
|
2393
|
-
var
|
|
2938
|
+
// src/adapters/client/ollamaClientAdapter/completions/index.ts
|
|
2939
|
+
var completions8 = function(param) {
|
|
2940
|
+
var ollama = param.ollama;
|
|
2394
2941
|
return {
|
|
2395
|
-
post:
|
|
2396
|
-
|
|
2942
|
+
post: post8({
|
|
2943
|
+
ollama: ollama
|
|
2397
2944
|
})
|
|
2398
2945
|
};
|
|
2399
2946
|
};
|
|
2400
|
-
// src/adapters/client/
|
|
2401
|
-
var
|
|
2402
|
-
var
|
|
2947
|
+
// src/adapters/client/ollamaClientAdapter/index.ts
|
|
2948
|
+
var ollamaClientAdapter = function(param) {
|
|
2949
|
+
var ollama = param.ollama;
|
|
2403
2950
|
return {
|
|
2404
|
-
client:
|
|
2951
|
+
client: ollama,
|
|
2405
2952
|
requestHandlers: {
|
|
2406
|
-
"^/v1/models$":
|
|
2407
|
-
|
|
2953
|
+
"^/v1/models$": models11({
|
|
2954
|
+
ollama: ollama
|
|
2408
2955
|
}),
|
|
2409
|
-
"^/(?:v1|/?openai)/chat/completions$":
|
|
2410
|
-
|
|
2956
|
+
"^/(?:v1|/?openai)/chat/completions$": completions8({
|
|
2957
|
+
ollama: ollama
|
|
2411
2958
|
})
|
|
2412
2959
|
}
|
|
2413
2960
|
};
|
|
@@ -2970,7 +3517,7 @@ var serializeThread = function(param) {
|
|
|
2970
3517
|
};
|
|
2971
3518
|
};
|
|
2972
3519
|
// src/adapters/storage/prismaStorageAdapter/threads/post.ts
|
|
2973
|
-
var
|
|
3520
|
+
var post9 = function(param) {
|
|
2974
3521
|
var prisma = param.prisma;
|
|
2975
3522
|
return /*#__PURE__*/ _async_to_generator(function() {
|
|
2976
3523
|
var _len, args, _key, body, messages3, metadata, initialCreatedAt, thread;
|
|
@@ -3040,7 +3587,7 @@ var post7 = function(param) {
|
|
|
3040
3587
|
var threads = function(param) {
|
|
3041
3588
|
var prisma = param.prisma;
|
|
3042
3589
|
return {
|
|
3043
|
-
post:
|
|
3590
|
+
post: post9({
|
|
3044
3591
|
prisma: prisma
|
|
3045
3592
|
})
|
|
3046
3593
|
};
|
|
@@ -3083,7 +3630,7 @@ var messageContentBlocks = function(param) {
|
|
|
3083
3630
|
}
|
|
3084
3631
|
];
|
|
3085
3632
|
};
|
|
3086
|
-
var
|
|
3633
|
+
var post10 = function(param) {
|
|
3087
3634
|
var prisma = param.prisma;
|
|
3088
3635
|
return /*#__PURE__*/ function() {
|
|
3089
3636
|
var _ref = _async_to_generator(function(urlString, options) {
|
|
@@ -3130,7 +3677,7 @@ var post8 = function(param) {
|
|
|
3130
3677
|
};
|
|
3131
3678
|
// src/adapters/storage/prismaStorageAdapter/threads/messages/get.ts
|
|
3132
3679
|
var import_radash7 = require("radash");
|
|
3133
|
-
var
|
|
3680
|
+
var get9 = function(param) {
|
|
3134
3681
|
var prisma = param.prisma;
|
|
3135
3682
|
return /*#__PURE__*/ function() {
|
|
3136
3683
|
var _ref = _async_to_generator(function(urlString) {
|
|
@@ -3196,10 +3743,10 @@ var get7 = function(param) {
|
|
|
3196
3743
|
var messages2 = function(param) {
|
|
3197
3744
|
var prisma = param.prisma;
|
|
3198
3745
|
return {
|
|
3199
|
-
post:
|
|
3746
|
+
post: post10({
|
|
3200
3747
|
prisma: prisma
|
|
3201
3748
|
}),
|
|
3202
|
-
get:
|
|
3749
|
+
get: get9({
|
|
3203
3750
|
prisma: prisma
|
|
3204
3751
|
})
|
|
3205
3752
|
};
|
|
@@ -3244,7 +3791,7 @@ var serializeRun = function(param) {
|
|
|
3244
3791
|
};
|
|
3245
3792
|
};
|
|
3246
3793
|
// src/adapters/storage/prismaStorageAdapter/threads/runs/get.ts
|
|
3247
|
-
var
|
|
3794
|
+
var get10 = function(param) {
|
|
3248
3795
|
var prisma = param.prisma;
|
|
3249
3796
|
return /*#__PURE__*/ function() {
|
|
3250
3797
|
var _ref = _async_to_generator(function(urlString) {
|
|
@@ -3667,7 +4214,7 @@ var getMessages = function(param) {
|
|
|
3667
4214
|
});
|
|
3668
4215
|
};
|
|
3669
4216
|
// src/adapters/storage/prismaStorageAdapter/threads/runs/post.ts
|
|
3670
|
-
var
|
|
4217
|
+
var post11 = function(param) {
|
|
3671
4218
|
var prisma = param.prisma, runAdapter = param.runAdapter;
|
|
3672
4219
|
return /*#__PURE__*/ function() {
|
|
3673
4220
|
var _ref = _async_to_generator(function(urlString, options) {
|
|
@@ -3841,17 +4388,17 @@ var post9 = function(param) {
|
|
|
3841
4388
|
var runs = function(param) {
|
|
3842
4389
|
var prisma = param.prisma, runAdapter = param.runAdapter;
|
|
3843
4390
|
return {
|
|
3844
|
-
get:
|
|
4391
|
+
get: get10({
|
|
3845
4392
|
prisma: prisma
|
|
3846
4393
|
}),
|
|
3847
|
-
post:
|
|
4394
|
+
post: post11({
|
|
3848
4395
|
prisma: prisma,
|
|
3849
4396
|
runAdapter: runAdapter
|
|
3850
4397
|
})
|
|
3851
4398
|
};
|
|
3852
4399
|
};
|
|
3853
4400
|
// src/adapters/storage/prismaStorageAdapter/threads/run/get.ts
|
|
3854
|
-
var
|
|
4401
|
+
var get11 = function(param) {
|
|
3855
4402
|
var prisma = param.prisma;
|
|
3856
4403
|
return /*#__PURE__*/ function() {
|
|
3857
4404
|
var _ref = _async_to_generator(function(urlString) {
|
|
@@ -3896,14 +4443,14 @@ var get9 = function(param) {
|
|
|
3896
4443
|
var run = function(param) {
|
|
3897
4444
|
var prisma = param.prisma, runAdapter = param.runAdapter;
|
|
3898
4445
|
return {
|
|
3899
|
-
get:
|
|
4446
|
+
get: get11({
|
|
3900
4447
|
prisma: prisma
|
|
3901
4448
|
})
|
|
3902
4449
|
};
|
|
3903
4450
|
};
|
|
3904
4451
|
// src/adapters/storage/prismaStorageAdapter/threads/runs/steps/get.ts
|
|
3905
4452
|
var import_radash10 = require("radash");
|
|
3906
|
-
var
|
|
4453
|
+
var get12 = function(param) {
|
|
3907
4454
|
var prisma = param.prisma;
|
|
3908
4455
|
return /*#__PURE__*/ function() {
|
|
3909
4456
|
var _ref = _async_to_generator(function(urlString) {
|
|
@@ -3971,7 +4518,7 @@ var get10 = function(param) {
|
|
|
3971
4518
|
var steps = function(param) {
|
|
3972
4519
|
var prisma = param.prisma;
|
|
3973
4520
|
return {
|
|
3974
|
-
get:
|
|
4521
|
+
get: get12({
|
|
3975
4522
|
prisma: prisma
|
|
3976
4523
|
})
|
|
3977
4524
|
};
|
|
@@ -4145,7 +4692,7 @@ var updateRun = /*#__PURE__*/ function() {
|
|
|
4145
4692
|
};
|
|
4146
4693
|
}();
|
|
4147
4694
|
// src/adapters/storage/prismaStorageAdapter/threads/runs/submitToolOutputs/post/index.ts
|
|
4148
|
-
var
|
|
4695
|
+
var post12 = function(param) {
|
|
4149
4696
|
var prisma = param.prisma, runAdapter = param.runAdapter;
|
|
4150
4697
|
return /*#__PURE__*/ function() {
|
|
4151
4698
|
var _ref = _async_to_generator(function(urlString, options) {
|
|
@@ -4320,7 +4867,7 @@ var post10 = function(param) {
|
|
|
4320
4867
|
var submitToolOutputs = function(param) {
|
|
4321
4868
|
var prisma = param.prisma, runAdapter = param.runAdapter;
|
|
4322
4869
|
return {
|
|
4323
|
-
post:
|
|
4870
|
+
post: post12({
|
|
4324
4871
|
prisma: prisma,
|
|
4325
4872
|
// @ts-ignore-next-line
|
|
4326
4873
|
runAdapter: runAdapter
|
|
@@ -4360,8 +4907,10 @@ var prismaStorageAdapter = function(param) {
|
|
|
4360
4907
|
anthropicClientAdapter: anthropicClientAdapter,
|
|
4361
4908
|
azureOpenaiClientAdapter: azureOpenaiClientAdapter,
|
|
4362
4909
|
completionsRunAdapter: completionsRunAdapter,
|
|
4910
|
+
googleClientAdapter: googleClientAdapter,
|
|
4363
4911
|
groqClientAdapter: groqClientAdapter,
|
|
4364
4912
|
mistralClientAdapter: mistralClientAdapter,
|
|
4913
|
+
ollamaClientAdapter: ollamaClientAdapter,
|
|
4365
4914
|
openaiClientAdapter: openaiClientAdapter,
|
|
4366
4915
|
perplexityClientAdapter: perplexityClientAdapter,
|
|
4367
4916
|
prismaStorageAdapter: prismaStorageAdapter,
|