@xiuper/mpp-core 0.0.2
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/Kotlin-DateTime-library-kotlinx-datetime.js +7836 -0
- package/Kotlin-DateTime-library-kotlinx-datetime.js.map +1 -0
- package/Kotlin-Immutable-Collections-kotlinx-collections-immutable.js +1241 -0
- package/Kotlin-Immutable-Collections-kotlinx-collections-immutable.js.map +1 -0
- package/Xiuper-mpp-codegraph.js +1471 -0
- package/Xiuper-mpp-codegraph.js.map +1 -0
- package/annotations.js +15 -0
- package/annotations.js.map +1 -0
- package/autodev-mpp-core.d.ts +1312 -0
- package/autodev-mpp-core.js +86483 -0
- package/autodev-mpp-core.js.map +1 -0
- package/kaml.js +3387 -0
- package/kaml.js.map +1 -0
- package/koog-agents-agents-core.js +22927 -0
- package/koog-agents-agents-core.js.map +1 -0
- package/koog-agents-agents-ext.js +15 -0
- package/koog-agents-agents-ext.js.map +1 -0
- package/koog-agents-agents-features-agents-features-event-handler.js +15 -0
- package/koog-agents-agents-features-agents-features-event-handler.js.map +1 -0
- package/koog-agents-agents-features-agents-features-memory.js +15 -0
- package/koog-agents-agents-features-agents-features-memory.js.map +1 -0
- package/koog-agents-agents-features-agents-features-opentelemetry.js +15 -0
- package/koog-agents-agents-features-agents-features-opentelemetry.js.map +1 -0
- package/koog-agents-agents-features-agents-features-snapshot.js +15 -0
- package/koog-agents-agents-features-agents-features-snapshot.js.map +1 -0
- package/koog-agents-agents-features-agents-features-tokenizer.js +15 -0
- package/koog-agents-agents-features-agents-features-tokenizer.js.map +1 -0
- package/koog-agents-agents-features-agents-features-trace.js +15 -0
- package/koog-agents-agents-features-agents-features-trace.js.map +1 -0
- package/koog-agents-agents-mcp.js +15 -0
- package/koog-agents-agents-mcp.js.map +1 -0
- package/koog-agents-agents-tools.js +322 -0
- package/koog-agents-agents-tools.js.map +1 -0
- package/koog-agents-agents-utils.js +232 -0
- package/koog-agents-agents-utils.js.map +1 -0
- package/koog-embeddings-embeddings-base.js +15 -0
- package/koog-embeddings-embeddings-base.js.map +1 -0
- package/koog-embeddings-embeddings-llm.js +15 -0
- package/koog-embeddings-embeddings-llm.js.map +1 -0
- package/koog-http-client-http-client-core.js +57 -0
- package/koog-http-client-http-client-core.js.map +1 -0
- package/koog-http-client-http-client-ktor.js +703 -0
- package/koog-http-client-http-client-ktor.js.map +1 -0
- package/koog-koog-agents.js +15 -0
- package/koog-koog-agents.js.map +1 -0
- package/koog-prompt-prompt-cache-prompt-cache-files.js +15 -0
- package/koog-prompt-prompt-cache-prompt-cache-files.js.map +1 -0
- package/koog-prompt-prompt-cache-prompt-cache-model.js +15 -0
- package/koog-prompt-prompt-cache-prompt-cache-model.js.map +1 -0
- package/koog-prompt-prompt-cache-prompt-cache-redis.js +15 -0
- package/koog-prompt-prompt-cache-prompt-cache-redis.js.map +1 -0
- package/koog-prompt-prompt-executor-prompt-executor-cached.js +15 -0
- package/koog-prompt-prompt-executor-prompt-executor-cached.js.map +1 -0
- package/koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-anthropic-client.js +4991 -0
- package/koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-anthropic-client.js.map +1 -0
- package/koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-bedrock-client.js +15 -0
- package/koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-bedrock-client.js.map +1 -0
- package/koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-dashscope-client.js +15 -0
- package/koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-dashscope-client.js.map +1 -0
- package/koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-deepseek-client.js +1249 -0
- package/koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-deepseek-client.js.map +1 -0
- package/koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-google-client.js +4675 -0
- package/koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-google-client.js.map +1 -0
- package/koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-mistralai-client.js +15 -0
- package/koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-mistralai-client.js.map +1 -0
- package/koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-ollama-client.js +2343 -0
- package/koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-ollama-client.js.map +1 -0
- package/koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-openai-client-base.js +6613 -0
- package/koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-openai-client-base.js.map +1 -0
- package/koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-openai-client.js +19901 -0
- package/koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-openai-client.js.map +1 -0
- package/koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-openrouter-client.js +2313 -0
- package/koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-openrouter-client.js.map +1 -0
- package/koog-prompt-prompt-executor-prompt-executor-clients.js +222 -0
- package/koog-prompt-prompt-executor-prompt-executor-clients.js.map +1 -0
- package/koog-prompt-prompt-executor-prompt-executor-llms-all.js +70 -0
- package/koog-prompt-prompt-executor-prompt-executor-llms-all.js.map +1 -0
- package/koog-prompt-prompt-executor-prompt-executor-llms.js +134 -0
- package/koog-prompt-prompt-executor-prompt-executor-llms.js.map +1 -0
- package/koog-prompt-prompt-executor-prompt-executor-model.js +42 -0
- package/koog-prompt-prompt-executor-prompt-executor-model.js.map +1 -0
- package/koog-prompt-prompt-llm.js +1710 -0
- package/koog-prompt-prompt-llm.js.map +1 -0
- package/koog-prompt-prompt-markdown.js +122 -0
- package/koog-prompt-prompt-markdown.js.map +1 -0
- package/koog-prompt-prompt-model.js +5848 -0
- package/koog-prompt-prompt-model.js.map +1 -0
- package/koog-prompt-prompt-structure.js +1513 -0
- package/koog-prompt-prompt-structure.js.map +1 -0
- package/koog-prompt-prompt-tokenizer.js +15 -0
- package/koog-prompt-prompt-tokenizer.js.map +1 -0
- package/koog-prompt-prompt-xml.js +15 -0
- package/koog-prompt-prompt-xml.js.map +1 -0
- package/koog-rag-rag-base.js +15 -0
- package/koog-rag-rag-base.js.map +1 -0
- package/koog-rag-vector-storage.js +15 -0
- package/koog-rag-vector-storage.js.map +1 -0
- package/koog-utils.js +63 -0
- package/koog-utils.js.map +1 -0
- package/kotlin-kotlin-stdlib.js +18965 -0
- package/kotlin-kotlin-stdlib.js.map +1 -0
- package/kotlin-logging.js +509 -0
- package/kotlin-logging.js.map +1 -0
- package/kotlin-sdk-kotlin-sdk-client.js +1340 -0
- package/kotlin-sdk-kotlin-sdk-client.js.map +1 -0
- package/kotlin-sdk-kotlin-sdk-core.js +15195 -0
- package/kotlin-sdk-kotlin-sdk-core.js.map +1 -0
- package/kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.js +15 -0
- package/kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.js.map +1 -0
- package/kotlinx-atomicfu.js +259 -0
- package/kotlinx-atomicfu.js.map +1 -0
- package/kotlinx-coroutines-core.js +13742 -0
- package/kotlinx-coroutines-core.js.map +1 -0
- package/kotlinx-io-kotlinx-io-bytestring.js +214 -0
- package/kotlinx-io-kotlinx-io-bytestring.js.map +1 -0
- package/kotlinx-io-kotlinx-io-core.js +2892 -0
- package/kotlinx-io-kotlinx-io-core.js.map +1 -0
- package/kotlinx-serialization-kotlinx-serialization-core.js +6563 -0
- package/kotlinx-serialization-kotlinx-serialization-core.js.map +1 -0
- package/kotlinx-serialization-kotlinx-serialization-json-io.js +15 -0
- package/kotlinx-serialization-kotlinx-serialization-json-io.js.map +1 -0
- package/kotlinx-serialization-kotlinx-serialization-json.js +5927 -0
- package/kotlinx-serialization-kotlinx-serialization-json.js.map +1 -0
- package/ktor-ktor-client-content-negotiation.js +775 -0
- package/ktor-ktor-client-content-negotiation.js.map +1 -0
- package/ktor-ktor-client-core.js +11110 -0
- package/ktor-ktor-client-core.js.map +1 -0
- package/ktor-ktor-client-logging.js +15 -0
- package/ktor-ktor-client-logging.js.map +1 -0
- package/ktor-ktor-events.js +126 -0
- package/ktor-ktor-events.js.map +1 -0
- package/ktor-ktor-http-cio.js +4257 -0
- package/ktor-ktor-http-cio.js.map +1 -0
- package/ktor-ktor-http.js +3671 -0
- package/ktor-ktor-http.js.map +1 -0
- package/ktor-ktor-io.js +4114 -0
- package/ktor-ktor-io.js.map +1 -0
- package/ktor-ktor-network.js +1399 -0
- package/ktor-ktor-network.js.map +1 -0
- package/ktor-ktor-serialization-kotlinx-json.js +67 -0
- package/ktor-ktor-serialization-kotlinx-json.js.map +1 -0
- package/ktor-ktor-serialization-kotlinx.js +881 -0
- package/ktor-ktor-serialization-kotlinx.js.map +1 -0
- package/ktor-ktor-serialization.js +388 -0
- package/ktor-ktor-serialization.js.map +1 -0
- package/ktor-ktor-server-cio.js +3735 -0
- package/ktor-ktor-server-cio.js.map +1 -0
- package/ktor-ktor-server-core.js +8696 -0
- package/ktor-ktor-server-core.js.map +1 -0
- package/ktor-ktor-server-sse.js +668 -0
- package/ktor-ktor-server-sse.js.map +1 -0
- package/ktor-ktor-server-websockets.js +15 -0
- package/ktor-ktor-server-websockets.js.map +1 -0
- package/ktor-ktor-sse.js +161 -0
- package/ktor-ktor-sse.js.map +1 -0
- package/ktor-ktor-utils.js +3589 -0
- package/ktor-ktor-utils.js.map +1 -0
- package/ktor-ktor-websocket-serialization.js +15 -0
- package/ktor-ktor-websocket-serialization.js.map +1 -0
- package/ktor-ktor-websockets.js +450 -0
- package/ktor-ktor-websockets.js.map +1 -0
- package/markdown.js +5174 -0
- package/markdown.js.map +1 -0
- package/okio-parent-okio.js +2628 -0
- package/okio-parent-okio.js.map +1 -0
- package/package.json +18 -0
- package/snakeyaml-engine-kmp.js +7079 -0
- package/snakeyaml-engine-kmp.js.map +1 -0
- package/urlencoder-urlencoder-lib.js +322 -0
- package/urlencoder-urlencoder-lib.js.map +1 -0
- package/xiuper-mpp-core.d.ts +1312 -0
- package/xiuper-mpp-core.js +86483 -0
- package/xiuper-mpp-core.js.map +1 -0
|
@@ -0,0 +1,2343 @@
|
|
|
1
|
+
(function (factory) {
|
|
2
|
+
if (typeof define === 'function' && define.amd)
|
|
3
|
+
define(['exports', './kotlin-kotlin-stdlib.js', './kotlin-logging.js', './koog-prompt-prompt-model.js', './ktor-ktor-http.js', './ktor-ktor-serialization-kotlinx-json.js', './ktor-ktor-client-core.js', './ktor-ktor-client-content-negotiation.js', './kotlinx-coroutines-core.js', './koog-prompt-prompt-llm.js', './ktor-ktor-utils.js', './ktor-ktor-io.js', './kotlinx-serialization-kotlinx-serialization-core.js', './koog-prompt-prompt-executor-prompt-executor-clients.js', './Kotlin-DateTime-library-kotlinx-datetime.js', './kotlinx-serialization-kotlinx-serialization-json.js', './koog-agents-agents-tools.js'], factory);
|
|
4
|
+
else if (typeof exports === 'object')
|
|
5
|
+
factory(module.exports, require('./kotlin-kotlin-stdlib.js'), require('./kotlin-logging.js'), require('./koog-prompt-prompt-model.js'), require('./ktor-ktor-http.js'), require('./ktor-ktor-serialization-kotlinx-json.js'), require('./ktor-ktor-client-core.js'), require('./ktor-ktor-client-content-negotiation.js'), require('./kotlinx-coroutines-core.js'), require('./koog-prompt-prompt-llm.js'), require('./ktor-ktor-utils.js'), require('./ktor-ktor-io.js'), require('./kotlinx-serialization-kotlinx-serialization-core.js'), require('./koog-prompt-prompt-executor-prompt-executor-clients.js'), require('./Kotlin-DateTime-library-kotlinx-datetime.js'), require('./kotlinx-serialization-kotlinx-serialization-json.js'), require('./koog-agents-agents-tools.js'));
|
|
6
|
+
else {
|
|
7
|
+
if (typeof globalThis['kotlin-kotlin-stdlib'] === 'undefined') {
|
|
8
|
+
throw new Error("Error loading module 'koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-ollama-client'. Its dependency 'kotlin-kotlin-stdlib' was not found. Please, check whether 'kotlin-kotlin-stdlib' is loaded prior to 'koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-ollama-client'.");
|
|
9
|
+
}
|
|
10
|
+
if (typeof globalThis['kotlin-logging'] === 'undefined') {
|
|
11
|
+
throw new Error("Error loading module 'koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-ollama-client'. Its dependency 'kotlin-logging' was not found. Please, check whether 'kotlin-logging' is loaded prior to 'koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-ollama-client'.");
|
|
12
|
+
}
|
|
13
|
+
if (typeof globalThis['koog-prompt-prompt-model'] === 'undefined') {
|
|
14
|
+
throw new Error("Error loading module 'koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-ollama-client'. Its dependency 'koog-prompt-prompt-model' was not found. Please, check whether 'koog-prompt-prompt-model' is loaded prior to 'koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-ollama-client'.");
|
|
15
|
+
}
|
|
16
|
+
if (typeof globalThis['ktor-ktor-http'] === 'undefined') {
|
|
17
|
+
throw new Error("Error loading module 'koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-ollama-client'. Its dependency 'ktor-ktor-http' was not found. Please, check whether 'ktor-ktor-http' is loaded prior to 'koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-ollama-client'.");
|
|
18
|
+
}
|
|
19
|
+
if (typeof globalThis['ktor-ktor-serialization-kotlinx-json'] === 'undefined') {
|
|
20
|
+
throw new Error("Error loading module 'koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-ollama-client'. Its dependency 'ktor-ktor-serialization-kotlinx-json' was not found. Please, check whether 'ktor-ktor-serialization-kotlinx-json' is loaded prior to 'koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-ollama-client'.");
|
|
21
|
+
}
|
|
22
|
+
if (typeof globalThis['ktor-ktor-client-core'] === 'undefined') {
|
|
23
|
+
throw new Error("Error loading module 'koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-ollama-client'. Its dependency 'ktor-ktor-client-core' was not found. Please, check whether 'ktor-ktor-client-core' is loaded prior to 'koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-ollama-client'.");
|
|
24
|
+
}
|
|
25
|
+
if (typeof globalThis['ktor-ktor-client-content-negotiation'] === 'undefined') {
|
|
26
|
+
throw new Error("Error loading module 'koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-ollama-client'. Its dependency 'ktor-ktor-client-content-negotiation' was not found. Please, check whether 'ktor-ktor-client-content-negotiation' is loaded prior to 'koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-ollama-client'.");
|
|
27
|
+
}
|
|
28
|
+
if (typeof globalThis['kotlinx-coroutines-core'] === 'undefined') {
|
|
29
|
+
throw new Error("Error loading module 'koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-ollama-client'. Its dependency 'kotlinx-coroutines-core' was not found. Please, check whether 'kotlinx-coroutines-core' is loaded prior to 'koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-ollama-client'.");
|
|
30
|
+
}
|
|
31
|
+
if (typeof globalThis['koog-prompt-prompt-llm'] === 'undefined') {
|
|
32
|
+
throw new Error("Error loading module 'koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-ollama-client'. Its dependency 'koog-prompt-prompt-llm' was not found. Please, check whether 'koog-prompt-prompt-llm' is loaded prior to 'koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-ollama-client'.");
|
|
33
|
+
}
|
|
34
|
+
if (typeof globalThis['ktor-ktor-utils'] === 'undefined') {
|
|
35
|
+
throw new Error("Error loading module 'koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-ollama-client'. Its dependency 'ktor-ktor-utils' was not found. Please, check whether 'ktor-ktor-utils' is loaded prior to 'koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-ollama-client'.");
|
|
36
|
+
}
|
|
37
|
+
if (typeof globalThis['ktor-ktor-io'] === 'undefined') {
|
|
38
|
+
throw new Error("Error loading module 'koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-ollama-client'. Its dependency 'ktor-ktor-io' was not found. Please, check whether 'ktor-ktor-io' is loaded prior to 'koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-ollama-client'.");
|
|
39
|
+
}
|
|
40
|
+
if (typeof globalThis['kotlinx-serialization-kotlinx-serialization-core'] === 'undefined') {
|
|
41
|
+
throw new Error("Error loading module 'koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-ollama-client'. Its dependency 'kotlinx-serialization-kotlinx-serialization-core' was not found. Please, check whether 'kotlinx-serialization-kotlinx-serialization-core' is loaded prior to 'koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-ollama-client'.");
|
|
42
|
+
}
|
|
43
|
+
if (typeof globalThis['koog-prompt-prompt-executor-prompt-executor-clients'] === 'undefined') {
|
|
44
|
+
throw new Error("Error loading module 'koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-ollama-client'. Its dependency 'koog-prompt-prompt-executor-prompt-executor-clients' was not found. Please, check whether 'koog-prompt-prompt-executor-prompt-executor-clients' is loaded prior to 'koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-ollama-client'.");
|
|
45
|
+
}
|
|
46
|
+
if (typeof globalThis['Kotlin-DateTime-library-kotlinx-datetime'] === 'undefined') {
|
|
47
|
+
throw new Error("Error loading module 'koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-ollama-client'. Its dependency 'Kotlin-DateTime-library-kotlinx-datetime' was not found. Please, check whether 'Kotlin-DateTime-library-kotlinx-datetime' is loaded prior to 'koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-ollama-client'.");
|
|
48
|
+
}
|
|
49
|
+
if (typeof globalThis['kotlinx-serialization-kotlinx-serialization-json'] === 'undefined') {
|
|
50
|
+
throw new Error("Error loading module 'koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-ollama-client'. Its dependency 'kotlinx-serialization-kotlinx-serialization-json' was not found. Please, check whether 'kotlinx-serialization-kotlinx-serialization-json' is loaded prior to 'koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-ollama-client'.");
|
|
51
|
+
}
|
|
52
|
+
if (typeof globalThis['koog-agents-agents-tools'] === 'undefined') {
|
|
53
|
+
throw new Error("Error loading module 'koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-ollama-client'. Its dependency 'koog-agents-agents-tools' was not found. Please, check whether 'koog-agents-agents-tools' is loaded prior to 'koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-ollama-client'.");
|
|
54
|
+
}
|
|
55
|
+
globalThis['koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-ollama-client'] = factory(typeof globalThis['koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-ollama-client'] === 'undefined' ? {} : globalThis['koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-ollama-client'], globalThis['kotlin-kotlin-stdlib'], globalThis['kotlin-logging'], globalThis['koog-prompt-prompt-model'], globalThis['ktor-ktor-http'], globalThis['ktor-ktor-serialization-kotlinx-json'], globalThis['ktor-ktor-client-core'], globalThis['ktor-ktor-client-content-negotiation'], globalThis['kotlinx-coroutines-core'], globalThis['koog-prompt-prompt-llm'], globalThis['ktor-ktor-utils'], globalThis['ktor-ktor-io'], globalThis['kotlinx-serialization-kotlinx-serialization-core'], globalThis['koog-prompt-prompt-executor-prompt-executor-clients'], globalThis['Kotlin-DateTime-library-kotlinx-datetime'], globalThis['kotlinx-serialization-kotlinx-serialization-json'], globalThis['koog-agents-agents-tools']);
|
|
56
|
+
}
|
|
57
|
+
}(function (_, kotlin_kotlin, kotlin_io_github_oshai_kotlin_logging, kotlin_ai_koog_prompt_model, kotlin_io_ktor_ktor_http, kotlin_io_ktor_ktor_serialization_kotlinx_json, kotlin_io_ktor_ktor_client_core, kotlin_io_ktor_ktor_client_content_negotiation, kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core, kotlin_ai_koog_prompt_llm, kotlin_io_ktor_ktor_utils, kotlin_io_ktor_ktor_io, kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core, kotlin_ai_koog_prompt_executor_clients, kotlin_org_jetbrains_kotlinx_kotlinx_datetime, kotlin_org_jetbrains_kotlinx_kotlinx_serialization_json, kotlin_ai_koog_agents_tools) {
|
|
58
|
+
'use strict';
|
|
59
|
+
//region block: imports
|
|
60
|
+
var imul = Math.imul;
|
|
61
|
+
var protoOf = kotlin_kotlin.$_$.we;
|
|
62
|
+
var THROW_CCE = kotlin_kotlin.$_$.zk;
|
|
63
|
+
var initMetadataForObject = kotlin_kotlin.$_$.ae;
|
|
64
|
+
var Unit_instance = kotlin_kotlin.$_$.h6;
|
|
65
|
+
var KotlinLogging_instance = kotlin_io_github_oshai_kotlin_logging.$_$.b;
|
|
66
|
+
var IllicitViolent_getInstance = kotlin_ai_koog_prompt_model.$_$.q1;
|
|
67
|
+
var Violence_getInstance = kotlin_ai_koog_prompt_model.$_$.y1;
|
|
68
|
+
var listOf = kotlin_kotlin.$_$.u9;
|
|
69
|
+
var to = kotlin_kotlin.$_$.hm;
|
|
70
|
+
var Illicit_getInstance = kotlin_ai_koog_prompt_model.$_$.r1;
|
|
71
|
+
var listOf_0 = kotlin_kotlin.$_$.t9;
|
|
72
|
+
var Sexual_getInstance = kotlin_ai_koog_prompt_model.$_$.w1;
|
|
73
|
+
var SexualMinors_getInstance = kotlin_ai_koog_prompt_model.$_$.v1;
|
|
74
|
+
var Defamation_getInstance = kotlin_ai_koog_prompt_model.$_$.n1;
|
|
75
|
+
var SpecializedAdvice_getInstance = kotlin_ai_koog_prompt_model.$_$.x1;
|
|
76
|
+
var Privacy_getInstance = kotlin_ai_koog_prompt_model.$_$.t1;
|
|
77
|
+
var IntellectualProperty_getInstance = kotlin_ai_koog_prompt_model.$_$.s1;
|
|
78
|
+
var Hate_getInstance = kotlin_ai_koog_prompt_model.$_$.p1;
|
|
79
|
+
var SelfHarm_getInstance = kotlin_ai_koog_prompt_model.$_$.u1;
|
|
80
|
+
var ElectionsMisinformation_getInstance = kotlin_ai_koog_prompt_model.$_$.o1;
|
|
81
|
+
var mapOf = kotlin_kotlin.$_$.x9;
|
|
82
|
+
var flatten = kotlin_kotlin.$_$.x8;
|
|
83
|
+
var distinct = kotlin_kotlin.$_$.i8;
|
|
84
|
+
var initMetadataForCompanion = kotlin_kotlin.$_$.vd;
|
|
85
|
+
var emptyList = kotlin_kotlin.$_$.m8;
|
|
86
|
+
var Companion_getInstance = kotlin_ai_koog_prompt_model.$_$.d2;
|
|
87
|
+
var charSequenceLength = kotlin_kotlin.$_$.id;
|
|
88
|
+
var Assistant_init_$Create$ = kotlin_ai_koog_prompt_model.$_$.j1;
|
|
89
|
+
var plus = kotlin_kotlin.$_$.ha;
|
|
90
|
+
var Application_getInstance = kotlin_io_ktor_ktor_http.$_$.d;
|
|
91
|
+
var contentType = kotlin_io_ktor_ktor_http.$_$.w1;
|
|
92
|
+
var json = kotlin_io_ktor_ktor_serialization_kotlinx_json.$_$.a;
|
|
93
|
+
var defaultRequest = kotlin_io_ktor_ktor_client_core.$_$.q;
|
|
94
|
+
var get_ContentNegotiation = kotlin_io_ktor_ktor_client_content_negotiation.$_$.a;
|
|
95
|
+
var get_HttpTimeout = kotlin_io_ktor_ktor_client_core.$_$.p;
|
|
96
|
+
var CoroutineImpl = kotlin_kotlin.$_$.tc;
|
|
97
|
+
var FlowCollector = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.e1;
|
|
98
|
+
var isInterface = kotlin_kotlin.$_$.je;
|
|
99
|
+
var Ollama_getInstance = kotlin_ai_koog_prompt_llm.$_$.v;
|
|
100
|
+
var equals = kotlin_kotlin.$_$.md;
|
|
101
|
+
var toString = kotlin_kotlin.$_$.af;
|
|
102
|
+
var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.e2;
|
|
103
|
+
var VOID = kotlin_kotlin.$_$.h;
|
|
104
|
+
var HttpRequestBuilder = kotlin_io_ktor_ktor_client_core.$_$.r;
|
|
105
|
+
var Companion_getInstance_0 = kotlin_io_ktor_ktor_http.$_$.j;
|
|
106
|
+
var url = kotlin_io_ktor_ktor_client_core.$_$.x;
|
|
107
|
+
var PrimitiveClasses_getInstance = kotlin_kotlin.$_$.t5;
|
|
108
|
+
var arrayOf = kotlin_kotlin.$_$.nl;
|
|
109
|
+
var createKType = kotlin_kotlin.$_$.c;
|
|
110
|
+
var TypeInfo = kotlin_io_ktor_ktor_utils.$_$.c1;
|
|
111
|
+
var OutgoingContent = kotlin_io_ktor_ktor_http.$_$.x;
|
|
112
|
+
var NullBody_instance = kotlin_io_ktor_ktor_http.$_$.b;
|
|
113
|
+
var HttpStatement = kotlin_io_ktor_ktor_client_core.$_$.z;
|
|
114
|
+
var get_COROUTINE_SUSPENDED = kotlin_kotlin.$_$.dc;
|
|
115
|
+
var bodyAsChannel = kotlin_io_ktor_ktor_client_core.$_$.e;
|
|
116
|
+
var readUTF8Line = kotlin_io_ktor_ktor_io.$_$.j;
|
|
117
|
+
var isBlank = kotlin_kotlin.$_$.eh;
|
|
118
|
+
var getKClass = kotlin_kotlin.$_$.f;
|
|
119
|
+
var serializer = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core.$_$.j4;
|
|
120
|
+
var KSerializer = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core.$_$.x3;
|
|
121
|
+
var emitAppend = kotlin_ai_koog_prompt_model.$_$.g1;
|
|
122
|
+
var emitToolCall = kotlin_ai_koog_prompt_model.$_$.i1;
|
|
123
|
+
var Exception = kotlin_kotlin.$_$.ok;
|
|
124
|
+
var initMetadataForLambda = kotlin_kotlin.$_$.zd;
|
|
125
|
+
var collectionSizeOrDefault = kotlin_kotlin.$_$.p7;
|
|
126
|
+
var ArrayList_init_$Create$ = kotlin_kotlin.$_$.s;
|
|
127
|
+
var isSuccess = kotlin_io_ktor_ktor_http.$_$.d2;
|
|
128
|
+
var RuntimeException_init_$Create$ = kotlin_kotlin.$_$.x2;
|
|
129
|
+
var initMetadataForCoroutine = kotlin_kotlin.$_$.wd;
|
|
130
|
+
var HttpClient = kotlin_io_ktor_ktor_client_core.$_$.b1;
|
|
131
|
+
var ConnectionTimeoutConfig = kotlin_ai_koog_prompt_executor_clients.$_$.b;
|
|
132
|
+
var System_instance = kotlin_org_jetbrains_kotlinx_kotlinx_datetime.$_$.b;
|
|
133
|
+
var Json = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_json.$_$.x;
|
|
134
|
+
var streamFrameFlow = kotlin_ai_koog_prompt_model.$_$.d1;
|
|
135
|
+
var LLMClient = kotlin_ai_koog_prompt_executor_clients.$_$.c;
|
|
136
|
+
var initMetadataForClass = kotlin_kotlin.$_$.ud;
|
|
137
|
+
var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.t;
|
|
138
|
+
var noWhenBranchMatchedException = kotlin_kotlin.$_$.zl;
|
|
139
|
+
var Result = kotlin_ai_koog_prompt_model.$_$.p;
|
|
140
|
+
var Default_getInstance = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_json.$_$.d;
|
|
141
|
+
var Call = kotlin_ai_koog_prompt_model.$_$.o;
|
|
142
|
+
var Assistant = kotlin_ai_koog_prompt_model.$_$.l;
|
|
143
|
+
var User = kotlin_ai_koog_prompt_model.$_$.r;
|
|
144
|
+
var System = kotlin_ai_koog_prompt_model.$_$.n;
|
|
145
|
+
var JSON_0 = kotlin_ai_koog_prompt_model.$_$.u;
|
|
146
|
+
var checkIndexOverflow = kotlin_kotlin.$_$.n7;
|
|
147
|
+
var JsonElement = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_json.$_$.o;
|
|
148
|
+
var Call_init_$Create$ = kotlin_ai_koog_prompt_model.$_$.k1;
|
|
149
|
+
var Image_getInstance = kotlin_ai_koog_prompt_llm.$_$.q;
|
|
150
|
+
var getKClassFromExpression = kotlin_kotlin.$_$.e;
|
|
151
|
+
var Binary = kotlin_ai_koog_prompt_model.$_$.d;
|
|
152
|
+
var Image = kotlin_ai_koog_prompt_model.$_$.i;
|
|
153
|
+
var Text = kotlin_ai_koog_prompt_model.$_$.j;
|
|
154
|
+
var getStringHashCode = kotlin_kotlin.$_$.sd;
|
|
155
|
+
var _UInt___init__impl__l7qpdl = kotlin_kotlin.$_$.g4;
|
|
156
|
+
var UInt = kotlin_kotlin.$_$.fl;
|
|
157
|
+
var AdditionalPropertiesFlatteningSerializer = kotlin_ai_koog_prompt_executor_clients.$_$.a;
|
|
158
|
+
var PluginGeneratedSerialDescriptor = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core.$_$.i3;
|
|
159
|
+
var DoubleSerializer_getInstance = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core.$_$.z;
|
|
160
|
+
var LongSerializer_getInstance = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core.$_$.d1;
|
|
161
|
+
var UnknownFieldException_init_$Create$ = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core.$_$.h;
|
|
162
|
+
var get_nullable = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core.$_$.i1;
|
|
163
|
+
var typeParametersSerializers = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core.$_$.b3;
|
|
164
|
+
var GeneratedSerializer = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core.$_$.c3;
|
|
165
|
+
var throwMissingFieldException = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core.$_$.o3;
|
|
166
|
+
var objectCreate = kotlin_kotlin.$_$.ve;
|
|
167
|
+
var ArrayListSerializer = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core.$_$.z2;
|
|
168
|
+
var StringSerializer_getInstance = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core.$_$.e1;
|
|
169
|
+
var JsonElementSerializer_getInstance = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_json.$_$.e;
|
|
170
|
+
var LinkedHashMapSerializer = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core.$_$.f3;
|
|
171
|
+
var toString_0 = kotlin_kotlin.$_$.gm;
|
|
172
|
+
var getNumberHashCode = kotlin_kotlin.$_$.qd;
|
|
173
|
+
var LazyThreadSafetyMode_PUBLICATION_getInstance = kotlin_kotlin.$_$.o;
|
|
174
|
+
var lazy = kotlin_kotlin.$_$.xl;
|
|
175
|
+
var BooleanSerializer_getInstance = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core.$_$.y;
|
|
176
|
+
var hashCode = kotlin_kotlin.$_$.td;
|
|
177
|
+
var getBooleanHashCode = kotlin_kotlin.$_$.od;
|
|
178
|
+
var IntSerializer_getInstance = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_core.$_$.c1;
|
|
179
|
+
var JsonObjectBuilder = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_json.$_$.q;
|
|
180
|
+
var JsonPrimitive = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_json.$_$.s;
|
|
181
|
+
var JsonObject = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_json.$_$.r;
|
|
182
|
+
var JsonArray = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_json.$_$.k;
|
|
183
|
+
var Object_0 = kotlin_ai_koog_agents_tools.$_$.h;
|
|
184
|
+
var put = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_json.$_$.i1;
|
|
185
|
+
var List = kotlin_ai_koog_agents_tools.$_$.g;
|
|
186
|
+
var Enum = kotlin_ai_koog_agents_tools.$_$.d;
|
|
187
|
+
var Boolean_0 = kotlin_ai_koog_agents_tools.$_$.c;
|
|
188
|
+
var Float = kotlin_ai_koog_agents_tools.$_$.e;
|
|
189
|
+
var Integer = kotlin_ai_koog_agents_tools.$_$.f;
|
|
190
|
+
var String_0 = kotlin_ai_koog_agents_tools.$_$.i;
|
|
191
|
+
//endregion
|
|
192
|
+
//region block: pre-declaration
|
|
193
|
+
initMetadataForObject(None, 'None');
|
|
194
|
+
initMetadataForCompanion(Companion);
|
|
195
|
+
initMetadataForLambda(OllamaClient$executeStreaming$slambda, CoroutineImpl, VOID, [1]);
|
|
196
|
+
initMetadataForCoroutine($executeCOROUTINE$, CoroutineImpl);
|
|
197
|
+
initMetadataForClass(OllamaClient, 'OllamaClient', OllamaClient, VOID, [LLMClient], [3, 2, 0, 1]);
|
|
198
|
+
initMetadataForObject(OllamaChatRequestDTOSerializer, 'OllamaChatRequestDTOSerializer', VOID, AdditionalPropertiesFlatteningSerializer);
|
|
199
|
+
initMetadataForCompanion(Companion_0);
|
|
200
|
+
initMetadataForObject($serializer, '$serializer', VOID, VOID, [GeneratedSerializer]);
|
|
201
|
+
initMetadataForClass(Options, 'Options', Options, VOID, VOID, VOID, VOID, {0: $serializer_getInstance});
|
|
202
|
+
initMetadataForCompanion(Companion_1);
|
|
203
|
+
initMetadataForObject($serializer_0, '$serializer', VOID, VOID, [GeneratedSerializer]);
|
|
204
|
+
initMetadataForClass(OllamaChatRequestDTO, 'OllamaChatRequestDTO', VOID, VOID, VOID, VOID, VOID, {0: $serializer_getInstance_0});
|
|
205
|
+
initMetadataForCompanion(Companion_2);
|
|
206
|
+
initMetadataForObject($serializer_1, '$serializer', VOID, VOID, [GeneratedSerializer]);
|
|
207
|
+
initMetadataForClass(OllamaChatMessageDTO, 'OllamaChatMessageDTO', VOID, VOID, VOID, VOID, VOID, {0: $serializer_getInstance_1});
|
|
208
|
+
initMetadataForCompanion(Companion_3);
|
|
209
|
+
initMetadataForObject($serializer_2, '$serializer', VOID, VOID, [GeneratedSerializer]);
|
|
210
|
+
initMetadataForClass(Definition, 'Definition', VOID, VOID, VOID, VOID, VOID, {0: $serializer_getInstance_2});
|
|
211
|
+
initMetadataForCompanion(Companion_4);
|
|
212
|
+
initMetadataForObject($serializer_3, '$serializer', VOID, VOID, [GeneratedSerializer]);
|
|
213
|
+
initMetadataForClass(OllamaToolDTO, 'OllamaToolDTO', VOID, VOID, VOID, VOID, VOID, {0: $serializer_getInstance_3});
|
|
214
|
+
initMetadataForCompanion(Companion_5);
|
|
215
|
+
initMetadataForObject($serializer_4, '$serializer', VOID, VOID, [GeneratedSerializer]);
|
|
216
|
+
initMetadataForClass(OllamaChatResponseDTO, 'OllamaChatResponseDTO', VOID, VOID, VOID, VOID, VOID, {0: $serializer_getInstance_4});
|
|
217
|
+
initMetadataForCompanion(Companion_6);
|
|
218
|
+
initMetadataForObject($serializer_5, '$serializer', VOID, VOID, [GeneratedSerializer]);
|
|
219
|
+
initMetadataForClass(OllamaErrorResponseDTO, 'OllamaErrorResponseDTO', VOID, VOID, VOID, VOID, VOID, {0: $serializer_getInstance_5});
|
|
220
|
+
initMetadataForCompanion(Companion_7);
|
|
221
|
+
initMetadataForObject($serializer_6, '$serializer', VOID, VOID, [GeneratedSerializer]);
|
|
222
|
+
initMetadataForClass(Call_0, 'Call', VOID, VOID, VOID, VOID, VOID, {0: $serializer_getInstance_6});
|
|
223
|
+
initMetadataForCompanion(Companion_8);
|
|
224
|
+
initMetadataForObject($serializer_7, '$serializer', VOID, VOID, [GeneratedSerializer]);
|
|
225
|
+
initMetadataForClass(OllamaToolCallDTO, 'OllamaToolCallDTO', VOID, VOID, VOID, VOID, VOID, {0: $serializer_getInstance_7});
|
|
226
|
+
//endregion
|
|
227
|
+
function None() {
|
|
228
|
+
}
|
|
229
|
+
protoOf(None).w93 = function (prompt, model) {
|
|
230
|
+
return null;
|
|
231
|
+
};
|
|
232
|
+
protoOf(None).toString = function () {
|
|
233
|
+
return 'None';
|
|
234
|
+
};
|
|
235
|
+
protoOf(None).hashCode = function () {
|
|
236
|
+
return -1233372242;
|
|
237
|
+
};
|
|
238
|
+
protoOf(None).equals = function (other) {
|
|
239
|
+
if (this === other)
|
|
240
|
+
return true;
|
|
241
|
+
if (!(other instanceof None))
|
|
242
|
+
return false;
|
|
243
|
+
other instanceof None || THROW_CCE();
|
|
244
|
+
return true;
|
|
245
|
+
};
|
|
246
|
+
var None_instance;
|
|
247
|
+
function None_getInstance() {
|
|
248
|
+
return None_instance;
|
|
249
|
+
}
|
|
250
|
+
function OllamaClient$Companion$logger$lambda() {
|
|
251
|
+
return Unit_instance;
|
|
252
|
+
}
|
|
253
|
+
function Companion() {
|
|
254
|
+
Companion_instance = this;
|
|
255
|
+
var tmp = this;
|
|
256
|
+
var tmp_0 = KotlinLogging_instance;
|
|
257
|
+
tmp.x93_1 = tmp_0.a3j(OllamaClient$Companion$logger$lambda);
|
|
258
|
+
this.y93_1 = 'api/chat';
|
|
259
|
+
this.z93_1 = 'api/embeddings';
|
|
260
|
+
this.a94_1 = 'api/tags';
|
|
261
|
+
this.b94_1 = 'api/show';
|
|
262
|
+
this.c94_1 = 'api/pull';
|
|
263
|
+
this.d94_1 = mapOf([to('S1', listOf([IllicitViolent_getInstance(), Violence_getInstance()])), to('S2', listOf_0(Illicit_getInstance())), to('S3', listOf([IllicitViolent_getInstance(), Sexual_getInstance()])), to('S4', listOf_0(SexualMinors_getInstance())), to('S5', listOf_0(Defamation_getInstance())), to('S6', listOf_0(SpecializedAdvice_getInstance())), to('S7', listOf_0(Privacy_getInstance())), to('S8', listOf_0(IntellectualProperty_getInstance())), to('S9', listOf_0(IllicitViolent_getInstance())), to('S10', listOf_0(Hate_getInstance())), to('S11', listOf_0(SelfHarm_getInstance())), to('S12', listOf_0(Sexual_getInstance())), to('S13', listOf_0(ElectionsMisinformation_getInstance()))]);
|
|
264
|
+
this.e94_1 = distinct(flatten(this.d94_1.l2()));
|
|
265
|
+
}
|
|
266
|
+
var Companion_instance;
|
|
267
|
+
function Companion_getInstance_1() {
|
|
268
|
+
if (Companion_instance == null)
|
|
269
|
+
new Companion();
|
|
270
|
+
return Companion_instance;
|
|
271
|
+
}
|
|
272
|
+
function parseResponse($this, response) {
|
|
273
|
+
var tmp0_elvis_lhs = response.g94_1;
|
|
274
|
+
var tmp;
|
|
275
|
+
if (tmp0_elvis_lhs == null) {
|
|
276
|
+
return emptyList();
|
|
277
|
+
} else {
|
|
278
|
+
tmp = tmp0_elvis_lhs;
|
|
279
|
+
}
|
|
280
|
+
var messages = tmp;
|
|
281
|
+
var content = messages.l94_1;
|
|
282
|
+
var tmp1_elvis_lhs = messages.n94_1;
|
|
283
|
+
var toolCalls = tmp1_elvis_lhs == null ? emptyList() : tmp1_elvis_lhs;
|
|
284
|
+
var promptTokenCount = response.i94_1;
|
|
285
|
+
var responseTokenCount = response.j94_1;
|
|
286
|
+
var totalTokensCount = !(promptTokenCount == null) && !(responseTokenCount == null) ? promptTokenCount + responseTokenCount | 0 : !(promptTokenCount == null) ? promptTokenCount : !(responseTokenCount == null) ? responseTokenCount : null;
|
|
287
|
+
var responseMetadata = Companion_getInstance().d46($this.p94_1, totalTokensCount, promptTokenCount, responseTokenCount);
|
|
288
|
+
var tmp_0;
|
|
289
|
+
var tmp_1;
|
|
290
|
+
// Inline function 'kotlin.text.isNotEmpty' call
|
|
291
|
+
if (charSequenceLength(content) > 0) {
|
|
292
|
+
tmp_1 = toolCalls.m();
|
|
293
|
+
} else {
|
|
294
|
+
tmp_1 = false;
|
|
295
|
+
}
|
|
296
|
+
if (tmp_1) {
|
|
297
|
+
tmp_0 = listOf_0(Assistant_init_$Create$(content, responseMetadata));
|
|
298
|
+
} else {
|
|
299
|
+
var tmp_2;
|
|
300
|
+
// Inline function 'kotlin.text.isEmpty' call
|
|
301
|
+
if (charSequenceLength(content) === 0) {
|
|
302
|
+
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
303
|
+
tmp_2 = !toolCalls.m();
|
|
304
|
+
} else {
|
|
305
|
+
tmp_2 = false;
|
|
306
|
+
}
|
|
307
|
+
if (tmp_2) {
|
|
308
|
+
tmp_0 = getToolCalls(messages, responseMetadata);
|
|
309
|
+
} else {
|
|
310
|
+
var toolCallMessages = getToolCalls(messages, responseMetadata);
|
|
311
|
+
var assistantMessage = Assistant_init_$Create$(content, responseMetadata);
|
|
312
|
+
tmp_0 = plus(listOf_0(assistantMessage), toolCallMessages);
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
return tmp_0;
|
|
316
|
+
}
|
|
317
|
+
function OllamaClient$ollamaJson$lambda($this$Json) {
|
|
318
|
+
$this$Json.c1i_1 = true;
|
|
319
|
+
$this$Json.d1i_1 = true;
|
|
320
|
+
return Unit_instance;
|
|
321
|
+
}
|
|
322
|
+
function OllamaClient$client$lambda$lambda(this$0) {
|
|
323
|
+
return function ($this$defaultRequest) {
|
|
324
|
+
$this$defaultRequest.p6g(this$0.o94_1);
|
|
325
|
+
contentType($this$defaultRequest, Application_getInstance().h57_1);
|
|
326
|
+
return Unit_instance;
|
|
327
|
+
};
|
|
328
|
+
}
|
|
329
|
+
function OllamaClient$client$lambda$lambda_0(this$0) {
|
|
330
|
+
return function ($this$install) {
|
|
331
|
+
json($this$install, this$0.r94_1);
|
|
332
|
+
return Unit_instance;
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
function OllamaClient$client$lambda$lambda_1($timeoutConfig) {
|
|
336
|
+
return function ($this$install) {
|
|
337
|
+
$this$install.g6v($timeoutConfig.p4f_1);
|
|
338
|
+
$this$install.h6v($timeoutConfig.q4f_1);
|
|
339
|
+
$this$install.i6v($timeoutConfig.r4f_1);
|
|
340
|
+
return Unit_instance;
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
function OllamaClient$client$lambda(this$0, $timeoutConfig) {
|
|
344
|
+
return function ($this$config) {
|
|
345
|
+
defaultRequest($this$config, OllamaClient$client$lambda$lambda(this$0));
|
|
346
|
+
var tmp = get_ContentNegotiation();
|
|
347
|
+
$this$config.e67(tmp, OllamaClient$client$lambda$lambda_0(this$0));
|
|
348
|
+
var tmp_0 = get_HttpTimeout();
|
|
349
|
+
$this$config.e67(tmp_0, OllamaClient$client$lambda$lambda_1($timeoutConfig));
|
|
350
|
+
return Unit_instance;
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
function OllamaClient$execute$lambda($errorResponse) {
|
|
354
|
+
return function () {
|
|
355
|
+
return 'Ollama error: ' + $errorResponse.t94_1;
|
|
356
|
+
};
|
|
357
|
+
}
|
|
358
|
+
function OllamaClient$executeStreaming$slambda($model, this$0, $prompt, resultContinuation) {
|
|
359
|
+
this.c95_1 = $model;
|
|
360
|
+
this.d95_1 = this$0;
|
|
361
|
+
this.e95_1 = $prompt;
|
|
362
|
+
CoroutineImpl.call(this, resultContinuation);
|
|
363
|
+
}
|
|
364
|
+
protoOf(OllamaClient$executeStreaming$slambda).z4d = function ($this$streamFrameFlow, $completion) {
|
|
365
|
+
var tmp = this.a4e($this$streamFrameFlow, $completion);
|
|
366
|
+
tmp.z9_1 = Unit_instance;
|
|
367
|
+
tmp.aa_1 = null;
|
|
368
|
+
return tmp.fa();
|
|
369
|
+
};
|
|
370
|
+
protoOf(OllamaClient$executeStreaming$slambda).ra = function (p1, $completion) {
|
|
371
|
+
return this.z4d((!(p1 == null) ? isInterface(p1, FlowCollector) : false) ? p1 : THROW_CCE(), $completion);
|
|
372
|
+
};
|
|
373
|
+
protoOf(OllamaClient$executeStreaming$slambda).fa = function () {
|
|
374
|
+
var suspendResult = this.z9_1;
|
|
375
|
+
$sm: do
|
|
376
|
+
try {
|
|
377
|
+
var tmp = this.x9_1;
|
|
378
|
+
switch (tmp) {
|
|
379
|
+
case 0:
|
|
380
|
+
this.y9_1 = 16;
|
|
381
|
+
if (!equals(this.c95_1.b3i_1, Ollama_getInstance())) {
|
|
382
|
+
var message = 'Model not supported by Ollama';
|
|
383
|
+
throw IllegalArgumentException_init_$Create$(toString(message));
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
this.g95_1 = this.d95_1.r94_1.gw(OllamaChatRequestDTOSerializer_getInstance(), new OllamaChatRequestDTO(this.c95_1.c3i_1, toOllamaChatMessages(this.e95_1, this.c95_1), VOID, VOID, this.d95_1.n96(this.e95_1, this.c95_1), true, VOID, this.e95_1.b45_1.d44_1));
|
|
387
|
+
var tmp_0 = this;
|
|
388
|
+
tmp_0.h95_1 = this.d95_1.s94_1;
|
|
389
|
+
var tmp_1 = this;
|
|
390
|
+
tmp_1.i95_1 = 'api/chat';
|
|
391
|
+
this.j95_1 = this.h95_1;
|
|
392
|
+
this.k95_1 = this.i95_1;
|
|
393
|
+
var tmp_2 = this;
|
|
394
|
+
tmp_2.l95_1 = this.j95_1;
|
|
395
|
+
this.m95_1 = this.l95_1;
|
|
396
|
+
this.n95_1 = new HttpRequestBuilder();
|
|
397
|
+
this.n95_1.x65_1 = Companion_getInstance_0().m5d_1;
|
|
398
|
+
var $this$post = this.n95_1;
|
|
399
|
+
url($this$post, this.k95_1);
|
|
400
|
+
var body = this.g95_1;
|
|
401
|
+
if (body == null) {
|
|
402
|
+
$this$post.z65_1 = NullBody_instance;
|
|
403
|
+
var tmp_3 = PrimitiveClasses_getInstance().fd();
|
|
404
|
+
var tmp_4;
|
|
405
|
+
try {
|
|
406
|
+
tmp_4 = createKType(PrimitiveClasses_getInstance().fd(), arrayOf([]), false);
|
|
407
|
+
} catch ($p) {
|
|
408
|
+
var tmp_5;
|
|
409
|
+
if ($p instanceof Error) {
|
|
410
|
+
var _unused_var__etf5q3 = $p;
|
|
411
|
+
tmp_5 = null;
|
|
412
|
+
} else {
|
|
413
|
+
throw $p;
|
|
414
|
+
}
|
|
415
|
+
tmp_4 = tmp_5;
|
|
416
|
+
}
|
|
417
|
+
$this$post.j6c(new TypeInfo(tmp_3, tmp_4));
|
|
418
|
+
} else {
|
|
419
|
+
if (body instanceof OutgoingContent) {
|
|
420
|
+
$this$post.z65_1 = body;
|
|
421
|
+
$this$post.j6c(null);
|
|
422
|
+
} else {
|
|
423
|
+
$this$post.z65_1 = body;
|
|
424
|
+
var tmp_6 = PrimitiveClasses_getInstance().fd();
|
|
425
|
+
var tmp_7;
|
|
426
|
+
try {
|
|
427
|
+
tmp_7 = createKType(PrimitiveClasses_getInstance().fd(), arrayOf([]), false);
|
|
428
|
+
} catch ($p) {
|
|
429
|
+
var tmp_8;
|
|
430
|
+
if ($p instanceof Error) {
|
|
431
|
+
var _unused_var__etf5q3_0 = $p;
|
|
432
|
+
tmp_8 = null;
|
|
433
|
+
} else {
|
|
434
|
+
throw $p;
|
|
435
|
+
}
|
|
436
|
+
tmp_7 = tmp_8;
|
|
437
|
+
}
|
|
438
|
+
$this$post.j6c(new TypeInfo(tmp_6, tmp_7));
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
this.n95_1.x65_1 = Companion_getInstance_0().m5d_1;
|
|
443
|
+
var tmp_9 = this;
|
|
444
|
+
tmp_9.o95_1 = this.m95_1;
|
|
445
|
+
var tmp_10 = this;
|
|
446
|
+
tmp_10.p95_1 = this.n95_1;
|
|
447
|
+
this.q95_1 = this.o95_1;
|
|
448
|
+
this.r95_1 = this.p95_1;
|
|
449
|
+
this.x9_1 = 1;
|
|
450
|
+
suspendResult = (new HttpStatement(this.r95_1, this.q95_1)).d7g(this);
|
|
451
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
452
|
+
return suspendResult;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
continue $sm;
|
|
456
|
+
case 1:
|
|
457
|
+
this.s95_1 = suspendResult;
|
|
458
|
+
this.x9_1 = 2;
|
|
459
|
+
suspendResult = bodyAsChannel(this.s95_1, this);
|
|
460
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
461
|
+
return suspendResult;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
continue $sm;
|
|
465
|
+
case 2:
|
|
466
|
+
this.t95_1 = suspendResult;
|
|
467
|
+
this.x9_1 = 3;
|
|
468
|
+
continue $sm;
|
|
469
|
+
case 3:
|
|
470
|
+
if (!!this.t95_1.l4i()) {
|
|
471
|
+
this.x9_1 = 15;
|
|
472
|
+
continue $sm;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
this.x9_1 = 4;
|
|
476
|
+
suspendResult = readUTF8Line(this.t95_1, VOID, this);
|
|
477
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
478
|
+
return suspendResult;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
continue $sm;
|
|
482
|
+
case 4:
|
|
483
|
+
this.u95_1 = suspendResult;
|
|
484
|
+
if (this.u95_1 == null) {
|
|
485
|
+
this.x9_1 = 15;
|
|
486
|
+
var tmp_11 = this;
|
|
487
|
+
continue $sm;
|
|
488
|
+
} else {
|
|
489
|
+
this.v95_1 = this.u95_1;
|
|
490
|
+
this.x9_1 = 5;
|
|
491
|
+
continue $sm;
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
case 5:
|
|
495
|
+
this.w95_1 = this.v95_1;
|
|
496
|
+
if (isBlank(this.w95_1)) {
|
|
497
|
+
this.x9_1 = 3;
|
|
498
|
+
continue $sm;
|
|
499
|
+
} else {
|
|
500
|
+
this.x9_1 = 6;
|
|
501
|
+
continue $sm;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
case 6:
|
|
505
|
+
this.y9_1 = 13;
|
|
506
|
+
var tmp_12 = this;
|
|
507
|
+
var tmp0 = this.d95_1.r94_1;
|
|
508
|
+
var string = this.w95_1;
|
|
509
|
+
var this_0 = tmp0.lz();
|
|
510
|
+
var this_1 = serializer(this_0, createKType(getKClass(OllamaChatResponseDTO), arrayOf([]), false));
|
|
511
|
+
tmp_12.y95_1 = tmp0.hw(isInterface(this_1, KSerializer) ? this_1 : THROW_CCE(), string);
|
|
512
|
+
this.z95_1 = this.y95_1.g94_1;
|
|
513
|
+
if (this.z95_1 == null) {
|
|
514
|
+
this.a96_1 = null;
|
|
515
|
+
this.x9_1 = 12;
|
|
516
|
+
continue $sm;
|
|
517
|
+
} else {
|
|
518
|
+
var tmp_13 = this;
|
|
519
|
+
tmp_13.b96_1 = this.z95_1;
|
|
520
|
+
this.c96_1 = this.b96_1;
|
|
521
|
+
var tmp_14 = this;
|
|
522
|
+
tmp_14.d96_1 = this.c96_1;
|
|
523
|
+
this.e96_1 = this.d96_1;
|
|
524
|
+
this.x9_1 = 7;
|
|
525
|
+
suspendResult = emitAppend(this.f95_1, this.e96_1.l94_1, this);
|
|
526
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
527
|
+
return suspendResult;
|
|
528
|
+
}
|
|
529
|
+
continue $sm;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
case 7:
|
|
533
|
+
this.f96_1 = this.e96_1.n94_1;
|
|
534
|
+
if (this.f96_1 == null) {
|
|
535
|
+
this.g96_1 = null;
|
|
536
|
+
this.x9_1 = 11;
|
|
537
|
+
continue $sm;
|
|
538
|
+
} else {
|
|
539
|
+
var tmp_15 = this;
|
|
540
|
+
tmp_15.h96_1 = this.f96_1;
|
|
541
|
+
this.i96_1 = this.h96_1;
|
|
542
|
+
this.j96_1 = this.i96_1.p();
|
|
543
|
+
this.x9_1 = 8;
|
|
544
|
+
continue $sm;
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
case 8:
|
|
548
|
+
if (!this.j96_1.q()) {
|
|
549
|
+
this.x9_1 = 10;
|
|
550
|
+
continue $sm;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
this.k96_1 = this.j96_1.r();
|
|
554
|
+
var tmp_16 = this;
|
|
555
|
+
tmp_16.l96_1 = this.k96_1;
|
|
556
|
+
this.m96_1 = this.l96_1;
|
|
557
|
+
this.x9_1 = 9;
|
|
558
|
+
suspendResult = emitToolCall(this.f95_1, null, this.m96_1.q96_1.o96_1, toString(this.m96_1.q96_1.p96_1), this);
|
|
559
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
560
|
+
return suspendResult;
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
continue $sm;
|
|
564
|
+
case 9:
|
|
565
|
+
this.x9_1 = 8;
|
|
566
|
+
continue $sm;
|
|
567
|
+
case 10:
|
|
568
|
+
this.g96_1 = Unit_instance;
|
|
569
|
+
this.x9_1 = 11;
|
|
570
|
+
continue $sm;
|
|
571
|
+
case 11:
|
|
572
|
+
this.a96_1 = this.g96_1;
|
|
573
|
+
this.x9_1 = 12;
|
|
574
|
+
continue $sm;
|
|
575
|
+
case 12:
|
|
576
|
+
this.x95_1 = this.a96_1;
|
|
577
|
+
this.y9_1 = 16;
|
|
578
|
+
this.x9_1 = 14;
|
|
579
|
+
continue $sm;
|
|
580
|
+
case 13:
|
|
581
|
+
this.y9_1 = 16;
|
|
582
|
+
var tmp_17 = this.aa_1;
|
|
583
|
+
if (tmp_17 instanceof Exception) {
|
|
584
|
+
var _unused_var__etf5q3_1 = this.aa_1;
|
|
585
|
+
this.x9_1 = 3;
|
|
586
|
+
var tmp_18 = this;
|
|
587
|
+
continue $sm;
|
|
588
|
+
} else {
|
|
589
|
+
throw this.aa_1;
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
case 14:
|
|
593
|
+
this.y9_1 = 16;
|
|
594
|
+
this.x9_1 = 3;
|
|
595
|
+
continue $sm;
|
|
596
|
+
case 15:
|
|
597
|
+
return Unit_instance;
|
|
598
|
+
case 16:
|
|
599
|
+
throw this.aa_1;
|
|
600
|
+
}
|
|
601
|
+
} catch ($p) {
|
|
602
|
+
var e = $p;
|
|
603
|
+
if (this.y9_1 === 16) {
|
|
604
|
+
throw e;
|
|
605
|
+
} else {
|
|
606
|
+
this.x9_1 = this.y9_1;
|
|
607
|
+
this.aa_1 = e;
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
while (true);
|
|
611
|
+
};
|
|
612
|
+
protoOf(OllamaClient$executeStreaming$slambda).a4e = function ($this$streamFrameFlow, completion) {
|
|
613
|
+
var i = new OllamaClient$executeStreaming$slambda(this.c95_1, this.d95_1, this.e95_1, completion);
|
|
614
|
+
i.f95_1 = $this$streamFrameFlow;
|
|
615
|
+
return i;
|
|
616
|
+
};
|
|
617
|
+
function OllamaClient$executeStreaming$slambda_0($model, this$0, $prompt, resultContinuation) {
|
|
618
|
+
var i = new OllamaClient$executeStreaming$slambda($model, this$0, $prompt, resultContinuation);
|
|
619
|
+
var l = function ($this$streamFrameFlow, $completion) {
|
|
620
|
+
return i.z4d($this$streamFrameFlow, $completion);
|
|
621
|
+
};
|
|
622
|
+
l.$arity = 1;
|
|
623
|
+
return l;
|
|
624
|
+
}
|
|
625
|
+
function $executeCOROUTINE$(_this__u8e3s4, prompt, model, tools, resultContinuation) {
|
|
626
|
+
CoroutineImpl.call(this, resultContinuation);
|
|
627
|
+
this.z96_1 = _this__u8e3s4;
|
|
628
|
+
this.a97_1 = prompt;
|
|
629
|
+
this.b97_1 = model;
|
|
630
|
+
this.c97_1 = tools;
|
|
631
|
+
}
|
|
632
|
+
protoOf($executeCOROUTINE$).fa = function () {
|
|
633
|
+
var suspendResult = this.z9_1;
|
|
634
|
+
$sm: do
|
|
635
|
+
try {
|
|
636
|
+
var tmp = this.x9_1;
|
|
637
|
+
switch (tmp) {
|
|
638
|
+
case 0:
|
|
639
|
+
this.y9_1 = 4;
|
|
640
|
+
if (!equals(this.b97_1.b3i_1, Ollama_getInstance())) {
|
|
641
|
+
var message = 'Model not supported by Ollama';
|
|
642
|
+
throw IllegalArgumentException_init_$Create$(toString(message));
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
var tmp_0 = this;
|
|
646
|
+
var tmp_1 = OllamaChatRequestDTOSerializer_getInstance();
|
|
647
|
+
var tmp_2 = toOllamaChatMessages(this.a97_1, this.b97_1);
|
|
648
|
+
var tmp_3;
|
|
649
|
+
if (!this.c97_1.m()) {
|
|
650
|
+
var this_0 = this.c97_1;
|
|
651
|
+
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
652
|
+
var _iterator__ex2g4s = this_0.p();
|
|
653
|
+
while (_iterator__ex2g4s.q()) {
|
|
654
|
+
var item = _iterator__ex2g4s.r();
|
|
655
|
+
destination.h(toOllamaTool(item));
|
|
656
|
+
}
|
|
657
|
+
tmp_3 = destination;
|
|
658
|
+
} else {
|
|
659
|
+
tmp_3 = null;
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
tmp_0.d97_1 = this.z96_1.r94_1.gw(tmp_1, new OllamaChatRequestDTO(this.b97_1.c3i_1, tmp_2, tmp_3, extractOllamaJsonFormat(this.a97_1), this.z96_1.n96(this.a97_1, this.b97_1), false, VOID, this.a97_1.b45_1.d44_1));
|
|
663
|
+
var tmp_4 = this;
|
|
664
|
+
tmp_4.e97_1 = this.z96_1.s94_1;
|
|
665
|
+
var tmp_5 = this;
|
|
666
|
+
tmp_5.f97_1 = 'api/chat';
|
|
667
|
+
this.g97_1 = this.e97_1;
|
|
668
|
+
this.h97_1 = this.f97_1;
|
|
669
|
+
var tmp_6 = this;
|
|
670
|
+
tmp_6.i97_1 = this.g97_1;
|
|
671
|
+
this.j97_1 = this.i97_1;
|
|
672
|
+
this.k97_1 = new HttpRequestBuilder();
|
|
673
|
+
this.k97_1.x65_1 = Companion_getInstance_0().m5d_1;
|
|
674
|
+
var $this$post = this.k97_1;
|
|
675
|
+
url($this$post, this.h97_1);
|
|
676
|
+
var body = this.d97_1;
|
|
677
|
+
if (body == null) {
|
|
678
|
+
$this$post.z65_1 = NullBody_instance;
|
|
679
|
+
var tmp_7 = PrimitiveClasses_getInstance().fd();
|
|
680
|
+
var tmp_8;
|
|
681
|
+
try {
|
|
682
|
+
tmp_8 = createKType(PrimitiveClasses_getInstance().fd(), arrayOf([]), false);
|
|
683
|
+
} catch ($p) {
|
|
684
|
+
var tmp_9;
|
|
685
|
+
if ($p instanceof Error) {
|
|
686
|
+
var _unused_var__etf5q3 = $p;
|
|
687
|
+
tmp_9 = null;
|
|
688
|
+
} else {
|
|
689
|
+
throw $p;
|
|
690
|
+
}
|
|
691
|
+
tmp_8 = tmp_9;
|
|
692
|
+
}
|
|
693
|
+
$this$post.j6c(new TypeInfo(tmp_7, tmp_8));
|
|
694
|
+
} else {
|
|
695
|
+
if (body instanceof OutgoingContent) {
|
|
696
|
+
$this$post.z65_1 = body;
|
|
697
|
+
$this$post.j6c(null);
|
|
698
|
+
} else {
|
|
699
|
+
$this$post.z65_1 = body;
|
|
700
|
+
var tmp_10 = PrimitiveClasses_getInstance().fd();
|
|
701
|
+
var tmp_11;
|
|
702
|
+
try {
|
|
703
|
+
tmp_11 = createKType(PrimitiveClasses_getInstance().fd(), arrayOf([]), false);
|
|
704
|
+
} catch ($p) {
|
|
705
|
+
var tmp_12;
|
|
706
|
+
if ($p instanceof Error) {
|
|
707
|
+
var _unused_var__etf5q3_0 = $p;
|
|
708
|
+
tmp_12 = null;
|
|
709
|
+
} else {
|
|
710
|
+
throw $p;
|
|
711
|
+
}
|
|
712
|
+
tmp_11 = tmp_12;
|
|
713
|
+
}
|
|
714
|
+
$this$post.j6c(new TypeInfo(tmp_10, tmp_11));
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
this.k97_1.x65_1 = Companion_getInstance_0().m5d_1;
|
|
719
|
+
var tmp_13 = this;
|
|
720
|
+
tmp_13.l97_1 = this.j97_1;
|
|
721
|
+
var tmp_14 = this;
|
|
722
|
+
tmp_14.m97_1 = this.k97_1;
|
|
723
|
+
this.n97_1 = this.l97_1;
|
|
724
|
+
this.o97_1 = this.m97_1;
|
|
725
|
+
this.x9_1 = 1;
|
|
726
|
+
suspendResult = (new HttpStatement(this.o97_1, this.n97_1)).d7g(this);
|
|
727
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
728
|
+
return suspendResult;
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
continue $sm;
|
|
732
|
+
case 1:
|
|
733
|
+
this.p97_1 = suspendResult;
|
|
734
|
+
if (isSuccess(this.p97_1.a5j())) {
|
|
735
|
+
var tmp_15 = this;
|
|
736
|
+
tmp_15.q97_1 = this.p97_1;
|
|
737
|
+
this.r97_1 = this.q97_1;
|
|
738
|
+
this.x9_1 = 3;
|
|
739
|
+
var tmp_16 = this.r97_1.m67();
|
|
740
|
+
var tmp_17 = getKClass(OllamaChatResponseDTO);
|
|
741
|
+
var tmp_18;
|
|
742
|
+
try {
|
|
743
|
+
tmp_18 = createKType(getKClass(OllamaChatResponseDTO), arrayOf([]), false);
|
|
744
|
+
} catch ($p) {
|
|
745
|
+
var tmp_19;
|
|
746
|
+
if ($p instanceof Error) {
|
|
747
|
+
var _unused_var__etf5q3_1 = $p;
|
|
748
|
+
tmp_19 = null;
|
|
749
|
+
} else {
|
|
750
|
+
throw $p;
|
|
751
|
+
}
|
|
752
|
+
tmp_18 = tmp_19;
|
|
753
|
+
}
|
|
754
|
+
suspendResult = tmp_16.j67(new TypeInfo(tmp_17, tmp_18), this);
|
|
755
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
756
|
+
return suspendResult;
|
|
757
|
+
}
|
|
758
|
+
continue $sm;
|
|
759
|
+
} else {
|
|
760
|
+
var tmp_20 = this;
|
|
761
|
+
tmp_20.s97_1 = this.p97_1;
|
|
762
|
+
this.t97_1 = this.s97_1;
|
|
763
|
+
this.x9_1 = 2;
|
|
764
|
+
var tmp_21 = this.t97_1.m67();
|
|
765
|
+
var tmp_22 = getKClass(OllamaErrorResponseDTO);
|
|
766
|
+
var tmp_23;
|
|
767
|
+
try {
|
|
768
|
+
tmp_23 = createKType(getKClass(OllamaErrorResponseDTO), arrayOf([]), false);
|
|
769
|
+
} catch ($p) {
|
|
770
|
+
var tmp_24;
|
|
771
|
+
if ($p instanceof Error) {
|
|
772
|
+
var _unused_var__etf5q3_2 = $p;
|
|
773
|
+
tmp_24 = null;
|
|
774
|
+
} else {
|
|
775
|
+
throw $p;
|
|
776
|
+
}
|
|
777
|
+
tmp_23 = tmp_24;
|
|
778
|
+
}
|
|
779
|
+
suspendResult = tmp_21.j67(new TypeInfo(tmp_22, tmp_23), this);
|
|
780
|
+
if (suspendResult === get_COROUTINE_SUSPENDED()) {
|
|
781
|
+
return suspendResult;
|
|
782
|
+
}
|
|
783
|
+
continue $sm;
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
case 2:
|
|
787
|
+
var errorResponse = suspendResult instanceof OllamaErrorResponseDTO ? suspendResult : THROW_CCE();
|
|
788
|
+
var tmp_25 = Companion_getInstance_1().x93_1;
|
|
789
|
+
tmp_25.r3i(OllamaClient$execute$lambda(errorResponse));
|
|
790
|
+
throw RuntimeException_init_$Create$('Ollama API error: ' + errorResponse.t94_1);
|
|
791
|
+
case 3:
|
|
792
|
+
var ARGUMENT = suspendResult instanceof OllamaChatResponseDTO ? suspendResult : THROW_CCE();
|
|
793
|
+
return parseResponse(this.z96_1, ARGUMENT);
|
|
794
|
+
case 4:
|
|
795
|
+
throw this.aa_1;
|
|
796
|
+
}
|
|
797
|
+
} catch ($p) {
|
|
798
|
+
var e = $p;
|
|
799
|
+
if (this.y9_1 === 4) {
|
|
800
|
+
throw e;
|
|
801
|
+
} else {
|
|
802
|
+
this.x9_1 = this.y9_1;
|
|
803
|
+
this.aa_1 = e;
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
while (true);
|
|
807
|
+
};
|
|
808
|
+
function OllamaClient(baseUrl, baseClient, timeoutConfig, clock, contextWindowStrategy) {
|
|
809
|
+
Companion_getInstance_1();
|
|
810
|
+
baseUrl = baseUrl === VOID ? 'http://localhost:11434' : baseUrl;
|
|
811
|
+
baseClient = baseClient === VOID ? HttpClient() : baseClient;
|
|
812
|
+
timeoutConfig = timeoutConfig === VOID ? new ConnectionTimeoutConfig() : timeoutConfig;
|
|
813
|
+
clock = clock === VOID ? System_instance : clock;
|
|
814
|
+
contextWindowStrategy = contextWindowStrategy === VOID ? None_instance : contextWindowStrategy;
|
|
815
|
+
this.o94_1 = baseUrl;
|
|
816
|
+
this.p94_1 = clock;
|
|
817
|
+
this.q94_1 = contextWindowStrategy;
|
|
818
|
+
var tmp = this;
|
|
819
|
+
tmp.r94_1 = Json(VOID, OllamaClient$ollamaJson$lambda);
|
|
820
|
+
var tmp_0 = this;
|
|
821
|
+
tmp_0.s94_1 = baseClient.a67(OllamaClient$client$lambda(this, timeoutConfig));
|
|
822
|
+
}
|
|
823
|
+
protoOf(OllamaClient).j4f = function (prompt, model, tools, $completion) {
|
|
824
|
+
var tmp = new $executeCOROUTINE$(this, prompt, model, tools, $completion);
|
|
825
|
+
tmp.z9_1 = Unit_instance;
|
|
826
|
+
tmp.aa_1 = null;
|
|
827
|
+
return tmp.fa();
|
|
828
|
+
};
|
|
829
|
+
protoOf(OllamaClient).l4f = function (prompt, model, tools) {
|
|
830
|
+
return streamFrameFlow(OllamaClient$executeStreaming$slambda_0(model, this, prompt, null));
|
|
831
|
+
};
|
|
832
|
+
protoOf(OllamaClient).n96 = function (prompt, model) {
|
|
833
|
+
return new Options(prompt.b45_1.u43_1, this.q94_1.w93(prompt, model));
|
|
834
|
+
};
|
|
835
|
+
function toOllamaChatMessages(_this__u8e3s4, model) {
|
|
836
|
+
// Inline function 'kotlin.collections.mutableListOf' call
|
|
837
|
+
var messages = ArrayList_init_$Create$_0();
|
|
838
|
+
var _iterator__ex2g4s = _this__u8e3s4.z44_1.p();
|
|
839
|
+
while (_iterator__ex2g4s.q()) {
|
|
840
|
+
var message = _iterator__ex2g4s.r();
|
|
841
|
+
var tmp;
|
|
842
|
+
if (message instanceof System) {
|
|
843
|
+
tmp = new OllamaChatMessageDTO('system', message.v1j());
|
|
844
|
+
} else {
|
|
845
|
+
if (message instanceof User) {
|
|
846
|
+
tmp = toOllamaChatMessage(message, model);
|
|
847
|
+
} else {
|
|
848
|
+
if (message instanceof Assistant) {
|
|
849
|
+
tmp = new OllamaChatMessageDTO('assistant', message.v1j());
|
|
850
|
+
} else {
|
|
851
|
+
if (message instanceof Call) {
|
|
852
|
+
tmp = new OllamaChatMessageDTO('assistant', '', VOID, listOf_0(new OllamaToolCallDTO(new Call_0(message.k45_1, Default_getInstance().k1h(message.v1j())))));
|
|
853
|
+
} else {
|
|
854
|
+
if (message instanceof Result) {
|
|
855
|
+
tmp = new OllamaChatMessageDTO('tool', message.v1j());
|
|
856
|
+
} else {
|
|
857
|
+
noWhenBranchMatchedException();
|
|
858
|
+
}
|
|
859
|
+
}
|
|
860
|
+
}
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
var converted = tmp;
|
|
864
|
+
messages.h(converted);
|
|
865
|
+
}
|
|
866
|
+
return messages;
|
|
867
|
+
}
|
|
868
|
+
function toOllamaTool(_this__u8e3s4) {
|
|
869
|
+
var jsonSchema = toJSONSchema(_this__u8e3s4);
|
|
870
|
+
return new OllamaToolDTO('function', new Definition(_this__u8e3s4.r7y_1, _this__u8e3s4.s7y_1, jsonSchema));
|
|
871
|
+
}
|
|
872
|
+
function extractOllamaJsonFormat(_this__u8e3s4) {
|
|
873
|
+
var schema = _this__u8e3s4.b45_1.y43_1;
|
|
874
|
+
var tmp;
|
|
875
|
+
if (!(schema == null) ? isInterface(schema, JSON_0) : false) {
|
|
876
|
+
tmp = schema.g4a();
|
|
877
|
+
} else {
|
|
878
|
+
tmp = null;
|
|
879
|
+
}
|
|
880
|
+
return tmp;
|
|
881
|
+
}
|
|
882
|
+
function getToolCalls(_this__u8e3s4, responseMetadata) {
|
|
883
|
+
// Inline function 'kotlin.collections.isNullOrEmpty' call
|
|
884
|
+
var this_0 = _this__u8e3s4.n94_1;
|
|
885
|
+
if (this_0 == null || this_0.m()) {
|
|
886
|
+
return emptyList();
|
|
887
|
+
}
|
|
888
|
+
// Inline function 'kotlin.collections.mapIndexed' call
|
|
889
|
+
var this_1 = _this__u8e3s4.n94_1;
|
|
890
|
+
// Inline function 'kotlin.collections.mapIndexedTo' call
|
|
891
|
+
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_1, 10));
|
|
892
|
+
var index = 0;
|
|
893
|
+
var _iterator__ex2g4s = this_1.p();
|
|
894
|
+
while (_iterator__ex2g4s.q()) {
|
|
895
|
+
var item = _iterator__ex2g4s.r();
|
|
896
|
+
var _unary__edvuaz = index;
|
|
897
|
+
index = _unary__edvuaz + 1 | 0;
|
|
898
|
+
var index_0 = checkIndexOverflow(_unary__edvuaz);
|
|
899
|
+
var name = item.q96_1.o96_1;
|
|
900
|
+
var tmp0 = Default_getInstance();
|
|
901
|
+
// Inline function 'kotlinx.serialization.json.Json.encodeToString' call
|
|
902
|
+
var value = item.q96_1.p96_1;
|
|
903
|
+
// Inline function 'kotlinx.serialization.serializer' call
|
|
904
|
+
var this_2 = tmp0.lz();
|
|
905
|
+
// Inline function 'kotlinx.serialization.internal.cast' call
|
|
906
|
+
var this_3 = serializer(this_2, createKType(getKClass(JsonElement), arrayOf([]), false));
|
|
907
|
+
var tmp$ret$2 = isInterface(this_3, KSerializer) ? this_3 : THROW_CCE();
|
|
908
|
+
var content = tmp0.gw(tmp$ret$2, value);
|
|
909
|
+
var tmp$ret$4 = Call_init_$Create$(generateToolCallId(name, content, index_0), name, content, responseMetadata);
|
|
910
|
+
destination.h(tmp$ret$4);
|
|
911
|
+
}
|
|
912
|
+
return destination;
|
|
913
|
+
}
|
|
914
|
+
function toOllamaChatMessage(_this__u8e3s4, model) {
|
|
915
|
+
// Inline function 'kotlin.collections.buildList' call
|
|
916
|
+
// Inline function 'kotlin.collections.buildListInternal' call
|
|
917
|
+
// Inline function 'kotlin.apply' call
|
|
918
|
+
var this_0 = ArrayList_init_$Create$_0();
|
|
919
|
+
// Inline function 'kotlin.collections.forEach' call
|
|
920
|
+
var _iterator__ex2g4s = _this__u8e3s4.e48_1.p();
|
|
921
|
+
while (_iterator__ex2g4s.q()) {
|
|
922
|
+
var element = _iterator__ex2g4s.r();
|
|
923
|
+
if (!(element instanceof Text)) {
|
|
924
|
+
if (element instanceof Image) {
|
|
925
|
+
// Inline function 'kotlin.require' call
|
|
926
|
+
if (!model.d3i_1.w(Image_getInstance())) {
|
|
927
|
+
var message = 'Model ' + model.c3i_1 + " doesn't support images";
|
|
928
|
+
throw IllegalArgumentException_init_$Create$(toString(message));
|
|
929
|
+
}
|
|
930
|
+
var content = element.b47_1;
|
|
931
|
+
var tmp;
|
|
932
|
+
if (isInterface(content, Binary)) {
|
|
933
|
+
tmp = content.t46();
|
|
934
|
+
} else {
|
|
935
|
+
throw IllegalArgumentException_init_$Create$('Unsupported image attachment content: ' + toString(getKClassFromExpression(content)));
|
|
936
|
+
}
|
|
937
|
+
var image = tmp;
|
|
938
|
+
this_0.h(image);
|
|
939
|
+
} else {
|
|
940
|
+
throw IllegalArgumentException_init_$Create$('Unsupported attachment type: ' + toString(element));
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
}
|
|
944
|
+
var images = this_0.e4();
|
|
945
|
+
var tmp_0 = _this__u8e3s4.v1j();
|
|
946
|
+
// Inline function 'kotlin.takeIf' call
|
|
947
|
+
var tmp_1;
|
|
948
|
+
// Inline function 'kotlin.collections.isNotEmpty' call
|
|
949
|
+
if (!images.m()) {
|
|
950
|
+
tmp_1 = images;
|
|
951
|
+
} else {
|
|
952
|
+
tmp_1 = null;
|
|
953
|
+
}
|
|
954
|
+
var tmp$ret$10 = tmp_1;
|
|
955
|
+
return new OllamaChatMessageDTO('user', tmp_0, tmp$ret$10);
|
|
956
|
+
}
|
|
957
|
+
function generateToolCallId(toolName, content, index) {
|
|
958
|
+
index = index === VOID ? 0 : index;
|
|
959
|
+
var combined = toolName + ':' + content + ':' + index;
|
|
960
|
+
var hashCode = getStringHashCode(combined);
|
|
961
|
+
// Inline function 'kotlin.toUInt' call
|
|
962
|
+
var tmp$ret$0 = _UInt___init__impl__l7qpdl(hashCode);
|
|
963
|
+
return 'ollama_tool_call_' + new UInt(tmp$ret$0);
|
|
964
|
+
}
|
|
965
|
+
function OllamaChatRequestDTOSerializer() {
|
|
966
|
+
OllamaChatRequestDTOSerializer_instance = this;
|
|
967
|
+
AdditionalPropertiesFlatteningSerializer.call(this, Companion_getInstance_3().q1j());
|
|
968
|
+
}
|
|
969
|
+
var OllamaChatRequestDTOSerializer_instance;
|
|
970
|
+
function OllamaChatRequestDTOSerializer_getInstance() {
|
|
971
|
+
if (OllamaChatRequestDTOSerializer_instance == null)
|
|
972
|
+
new OllamaChatRequestDTOSerializer();
|
|
973
|
+
return OllamaChatRequestDTOSerializer_instance;
|
|
974
|
+
}
|
|
975
|
+
function Companion_0() {
|
|
976
|
+
}
|
|
977
|
+
var Companion_instance_0;
|
|
978
|
+
function Companion_getInstance_2() {
|
|
979
|
+
return Companion_instance_0;
|
|
980
|
+
}
|
|
981
|
+
function $serializer() {
|
|
982
|
+
$serializer_instance = this;
|
|
983
|
+
var tmp0_serialDesc = new PluginGeneratedSerialDescriptor('ai.koog.prompt.executor.ollama.client.dto.OllamaChatRequestDTO.Options', this, 2);
|
|
984
|
+
tmp0_serialDesc.m16('temperature', true);
|
|
985
|
+
tmp0_serialDesc.m16('num_ctx', true);
|
|
986
|
+
this.v97_1 = tmp0_serialDesc;
|
|
987
|
+
}
|
|
988
|
+
protoOf($serializer).w97 = function (encoder, value) {
|
|
989
|
+
var tmp0_desc = this.v97_1;
|
|
990
|
+
var tmp1_output = encoder.wy(tmp0_desc);
|
|
991
|
+
if (tmp1_output.t10(tmp0_desc, 0) ? true : !(value.x97_1 == null)) {
|
|
992
|
+
tmp1_output.p10(tmp0_desc, 0, DoubleSerializer_getInstance(), value.x97_1);
|
|
993
|
+
}
|
|
994
|
+
if (tmp1_output.t10(tmp0_desc, 1) ? true : !(value.y97_1 == null)) {
|
|
995
|
+
tmp1_output.p10(tmp0_desc, 1, LongSerializer_getInstance(), value.y97_1);
|
|
996
|
+
}
|
|
997
|
+
tmp1_output.xy(tmp0_desc);
|
|
998
|
+
};
|
|
999
|
+
protoOf($serializer).gv = function (encoder, value) {
|
|
1000
|
+
return this.w97(encoder, value instanceof Options ? value : THROW_CCE());
|
|
1001
|
+
};
|
|
1002
|
+
protoOf($serializer).hv = function (decoder) {
|
|
1003
|
+
var tmp0_desc = this.v97_1;
|
|
1004
|
+
var tmp1_flag = true;
|
|
1005
|
+
var tmp2_index = 0;
|
|
1006
|
+
var tmp3_bitMask0 = 0;
|
|
1007
|
+
var tmp4_local0 = null;
|
|
1008
|
+
var tmp5_local1 = null;
|
|
1009
|
+
var tmp6_input = decoder.wy(tmp0_desc);
|
|
1010
|
+
if (tmp6_input.mz()) {
|
|
1011
|
+
tmp4_local0 = tmp6_input.kz(tmp0_desc, 0, DoubleSerializer_getInstance(), tmp4_local0);
|
|
1012
|
+
tmp3_bitMask0 = tmp3_bitMask0 | 1;
|
|
1013
|
+
tmp5_local1 = tmp6_input.kz(tmp0_desc, 1, LongSerializer_getInstance(), tmp5_local1);
|
|
1014
|
+
tmp3_bitMask0 = tmp3_bitMask0 | 2;
|
|
1015
|
+
} else
|
|
1016
|
+
while (tmp1_flag) {
|
|
1017
|
+
tmp2_index = tmp6_input.nz(tmp0_desc);
|
|
1018
|
+
switch (tmp2_index) {
|
|
1019
|
+
case -1:
|
|
1020
|
+
tmp1_flag = false;
|
|
1021
|
+
break;
|
|
1022
|
+
case 0:
|
|
1023
|
+
tmp4_local0 = tmp6_input.kz(tmp0_desc, 0, DoubleSerializer_getInstance(), tmp4_local0);
|
|
1024
|
+
tmp3_bitMask0 = tmp3_bitMask0 | 1;
|
|
1025
|
+
break;
|
|
1026
|
+
case 1:
|
|
1027
|
+
tmp5_local1 = tmp6_input.kz(tmp0_desc, 1, LongSerializer_getInstance(), tmp5_local1);
|
|
1028
|
+
tmp3_bitMask0 = tmp3_bitMask0 | 2;
|
|
1029
|
+
break;
|
|
1030
|
+
default:
|
|
1031
|
+
throw UnknownFieldException_init_$Create$(tmp2_index);
|
|
1032
|
+
}
|
|
1033
|
+
}
|
|
1034
|
+
tmp6_input.xy(tmp0_desc);
|
|
1035
|
+
return Options_init_$Create$(tmp3_bitMask0, tmp4_local0, tmp5_local1, null);
|
|
1036
|
+
};
|
|
1037
|
+
protoOf($serializer).fv = function () {
|
|
1038
|
+
return this.v97_1;
|
|
1039
|
+
};
|
|
1040
|
+
protoOf($serializer).d17 = function () {
|
|
1041
|
+
// Inline function 'kotlin.arrayOf' call
|
|
1042
|
+
// Inline function 'kotlin.js.unsafeCast' call
|
|
1043
|
+
// Inline function 'kotlin.js.asDynamic' call
|
|
1044
|
+
return [get_nullable(DoubleSerializer_getInstance()), get_nullable(LongSerializer_getInstance())];
|
|
1045
|
+
};
|
|
1046
|
+
var $serializer_instance;
|
|
1047
|
+
function $serializer_getInstance() {
|
|
1048
|
+
if ($serializer_instance == null)
|
|
1049
|
+
new $serializer();
|
|
1050
|
+
return $serializer_instance;
|
|
1051
|
+
}
|
|
1052
|
+
function Options_init_$Init$(seen0, temperature, numCtx, serializationConstructorMarker, $this) {
|
|
1053
|
+
if (!(0 === (0 & seen0))) {
|
|
1054
|
+
throwMissingFieldException(seen0, 0, $serializer_getInstance().v97_1);
|
|
1055
|
+
}
|
|
1056
|
+
if (0 === (seen0 & 1))
|
|
1057
|
+
$this.x97_1 = null;
|
|
1058
|
+
else
|
|
1059
|
+
$this.x97_1 = temperature;
|
|
1060
|
+
if (0 === (seen0 & 2))
|
|
1061
|
+
$this.y97_1 = null;
|
|
1062
|
+
else
|
|
1063
|
+
$this.y97_1 = numCtx;
|
|
1064
|
+
return $this;
|
|
1065
|
+
}
|
|
1066
|
+
function Options_init_$Create$(seen0, temperature, numCtx, serializationConstructorMarker) {
|
|
1067
|
+
return Options_init_$Init$(seen0, temperature, numCtx, serializationConstructorMarker, objectCreate(protoOf(Options)));
|
|
1068
|
+
}
|
|
1069
|
+
function OllamaChatRequestDTO$Companion$$childSerializers$_anonymous__jtydy4() {
|
|
1070
|
+
return new ArrayListSerializer($serializer_getInstance_1());
|
|
1071
|
+
}
|
|
1072
|
+
function OllamaChatRequestDTO$Companion$$childSerializers$_anonymous__jtydy4_0() {
|
|
1073
|
+
return new ArrayListSerializer($serializer_getInstance_3());
|
|
1074
|
+
}
|
|
1075
|
+
function OllamaChatRequestDTO$Companion$$childSerializers$_anonymous__jtydy4_1() {
|
|
1076
|
+
return new LinkedHashMapSerializer(StringSerializer_getInstance(), JsonElementSerializer_getInstance());
|
|
1077
|
+
}
|
|
1078
|
+
function Options(temperature, numCtx) {
|
|
1079
|
+
temperature = temperature === VOID ? null : temperature;
|
|
1080
|
+
numCtx = numCtx === VOID ? null : numCtx;
|
|
1081
|
+
this.x97_1 = temperature;
|
|
1082
|
+
this.y97_1 = numCtx;
|
|
1083
|
+
}
|
|
1084
|
+
protoOf(Options).toString = function () {
|
|
1085
|
+
return 'Options(temperature=' + this.x97_1 + ', numCtx=' + toString_0(this.y97_1) + ')';
|
|
1086
|
+
};
|
|
1087
|
+
protoOf(Options).hashCode = function () {
|
|
1088
|
+
var result = this.x97_1 == null ? 0 : getNumberHashCode(this.x97_1);
|
|
1089
|
+
result = imul(result, 31) + (this.y97_1 == null ? 0 : this.y97_1.hashCode()) | 0;
|
|
1090
|
+
return result;
|
|
1091
|
+
};
|
|
1092
|
+
protoOf(Options).equals = function (other) {
|
|
1093
|
+
if (this === other)
|
|
1094
|
+
return true;
|
|
1095
|
+
if (!(other instanceof Options))
|
|
1096
|
+
return false;
|
|
1097
|
+
var tmp0_other_with_cast = other instanceof Options ? other : THROW_CCE();
|
|
1098
|
+
if (!equals(this.x97_1, tmp0_other_with_cast.x97_1))
|
|
1099
|
+
return false;
|
|
1100
|
+
if (!equals(this.y97_1, tmp0_other_with_cast.y97_1))
|
|
1101
|
+
return false;
|
|
1102
|
+
return true;
|
|
1103
|
+
};
|
|
1104
|
+
function Companion_1() {
|
|
1105
|
+
Companion_instance_1 = this;
|
|
1106
|
+
var tmp = this;
|
|
1107
|
+
var tmp_0 = LazyThreadSafetyMode_PUBLICATION_getInstance();
|
|
1108
|
+
var tmp_1 = lazy(tmp_0, OllamaChatRequestDTO$Companion$$childSerializers$_anonymous__jtydy4);
|
|
1109
|
+
var tmp_2 = LazyThreadSafetyMode_PUBLICATION_getInstance();
|
|
1110
|
+
var tmp_3 = lazy(tmp_2, OllamaChatRequestDTO$Companion$$childSerializers$_anonymous__jtydy4_0);
|
|
1111
|
+
var tmp_4 = LazyThreadSafetyMode_PUBLICATION_getInstance();
|
|
1112
|
+
// Inline function 'kotlin.arrayOf' call
|
|
1113
|
+
// Inline function 'kotlin.js.unsafeCast' call
|
|
1114
|
+
// Inline function 'kotlin.js.asDynamic' call
|
|
1115
|
+
tmp.u97_1 = [null, tmp_1, tmp_3, null, null, null, null, lazy(tmp_4, OllamaChatRequestDTO$Companion$$childSerializers$_anonymous__jtydy4_1)];
|
|
1116
|
+
}
|
|
1117
|
+
protoOf(Companion_1).q1j = function () {
|
|
1118
|
+
return $serializer_getInstance_0();
|
|
1119
|
+
};
|
|
1120
|
+
var Companion_instance_1;
|
|
1121
|
+
function Companion_getInstance_3() {
|
|
1122
|
+
if (Companion_instance_1 == null)
|
|
1123
|
+
new Companion_1();
|
|
1124
|
+
return Companion_instance_1;
|
|
1125
|
+
}
|
|
1126
|
+
function $serializer_0() {
|
|
1127
|
+
$serializer_instance_0 = this;
|
|
1128
|
+
var tmp0_serialDesc = new PluginGeneratedSerialDescriptor('ai.koog.prompt.executor.ollama.client.dto.OllamaChatRequestDTO', this, 8);
|
|
1129
|
+
tmp0_serialDesc.m16('model', false);
|
|
1130
|
+
tmp0_serialDesc.m16('messages', false);
|
|
1131
|
+
tmp0_serialDesc.m16('tools', true);
|
|
1132
|
+
tmp0_serialDesc.m16('format', true);
|
|
1133
|
+
tmp0_serialDesc.m16('options', true);
|
|
1134
|
+
tmp0_serialDesc.m16('stream', false);
|
|
1135
|
+
tmp0_serialDesc.m16('keep_alive', true);
|
|
1136
|
+
tmp0_serialDesc.m16('additionalProperties', true);
|
|
1137
|
+
this.z97_1 = tmp0_serialDesc;
|
|
1138
|
+
}
|
|
1139
|
+
protoOf($serializer_0).a98 = function (encoder, value) {
|
|
1140
|
+
var tmp0_desc = this.z97_1;
|
|
1141
|
+
var tmp1_output = encoder.wy(tmp0_desc);
|
|
1142
|
+
var tmp2_cached = Companion_getInstance_3().u97_1;
|
|
1143
|
+
tmp1_output.l10(tmp0_desc, 0, value.b98_1);
|
|
1144
|
+
tmp1_output.n10(tmp0_desc, 1, tmp2_cached[1].b1(), value.c98_1);
|
|
1145
|
+
if (tmp1_output.t10(tmp0_desc, 2) ? true : !(value.d98_1 == null)) {
|
|
1146
|
+
tmp1_output.p10(tmp0_desc, 2, tmp2_cached[2].b1(), value.d98_1);
|
|
1147
|
+
}
|
|
1148
|
+
if (tmp1_output.t10(tmp0_desc, 3) ? true : !(value.e98_1 == null)) {
|
|
1149
|
+
tmp1_output.p10(tmp0_desc, 3, JsonElementSerializer_getInstance(), value.e98_1);
|
|
1150
|
+
}
|
|
1151
|
+
if (tmp1_output.t10(tmp0_desc, 4) ? true : !(value.f98_1 == null)) {
|
|
1152
|
+
tmp1_output.p10(tmp0_desc, 4, $serializer_getInstance(), value.f98_1);
|
|
1153
|
+
}
|
|
1154
|
+
tmp1_output.d10(tmp0_desc, 5, value.g98_1);
|
|
1155
|
+
if (tmp1_output.t10(tmp0_desc, 6) ? true : !(value.h98_1 == null)) {
|
|
1156
|
+
tmp1_output.p10(tmp0_desc, 6, StringSerializer_getInstance(), value.h98_1);
|
|
1157
|
+
}
|
|
1158
|
+
if (tmp1_output.t10(tmp0_desc, 7) ? true : !(value.i98_1 == null)) {
|
|
1159
|
+
tmp1_output.p10(tmp0_desc, 7, tmp2_cached[7].b1(), value.i98_1);
|
|
1160
|
+
}
|
|
1161
|
+
tmp1_output.xy(tmp0_desc);
|
|
1162
|
+
};
|
|
1163
|
+
protoOf($serializer_0).gv = function (encoder, value) {
|
|
1164
|
+
return this.a98(encoder, value instanceof OllamaChatRequestDTO ? value : THROW_CCE());
|
|
1165
|
+
};
|
|
1166
|
+
protoOf($serializer_0).hv = function (decoder) {
|
|
1167
|
+
var tmp0_desc = this.z97_1;
|
|
1168
|
+
var tmp1_flag = true;
|
|
1169
|
+
var tmp2_index = 0;
|
|
1170
|
+
var tmp3_bitMask0 = 0;
|
|
1171
|
+
var tmp4_local0 = null;
|
|
1172
|
+
var tmp5_local1 = null;
|
|
1173
|
+
var tmp6_local2 = null;
|
|
1174
|
+
var tmp7_local3 = null;
|
|
1175
|
+
var tmp8_local4 = null;
|
|
1176
|
+
var tmp9_local5 = false;
|
|
1177
|
+
var tmp10_local6 = null;
|
|
1178
|
+
var tmp11_local7 = null;
|
|
1179
|
+
var tmp12_input = decoder.wy(tmp0_desc);
|
|
1180
|
+
var tmp13_cached = Companion_getInstance_3().u97_1;
|
|
1181
|
+
if (tmp12_input.mz()) {
|
|
1182
|
+
tmp4_local0 = tmp12_input.gz(tmp0_desc, 0);
|
|
1183
|
+
tmp3_bitMask0 = tmp3_bitMask0 | 1;
|
|
1184
|
+
tmp5_local1 = tmp12_input.iz(tmp0_desc, 1, tmp13_cached[1].b1(), tmp5_local1);
|
|
1185
|
+
tmp3_bitMask0 = tmp3_bitMask0 | 2;
|
|
1186
|
+
tmp6_local2 = tmp12_input.kz(tmp0_desc, 2, tmp13_cached[2].b1(), tmp6_local2);
|
|
1187
|
+
tmp3_bitMask0 = tmp3_bitMask0 | 4;
|
|
1188
|
+
tmp7_local3 = tmp12_input.kz(tmp0_desc, 3, JsonElementSerializer_getInstance(), tmp7_local3);
|
|
1189
|
+
tmp3_bitMask0 = tmp3_bitMask0 | 8;
|
|
1190
|
+
tmp8_local4 = tmp12_input.kz(tmp0_desc, 4, $serializer_getInstance(), tmp8_local4);
|
|
1191
|
+
tmp3_bitMask0 = tmp3_bitMask0 | 16;
|
|
1192
|
+
tmp9_local5 = tmp12_input.yy(tmp0_desc, 5);
|
|
1193
|
+
tmp3_bitMask0 = tmp3_bitMask0 | 32;
|
|
1194
|
+
tmp10_local6 = tmp12_input.kz(tmp0_desc, 6, StringSerializer_getInstance(), tmp10_local6);
|
|
1195
|
+
tmp3_bitMask0 = tmp3_bitMask0 | 64;
|
|
1196
|
+
tmp11_local7 = tmp12_input.kz(tmp0_desc, 7, tmp13_cached[7].b1(), tmp11_local7);
|
|
1197
|
+
tmp3_bitMask0 = tmp3_bitMask0 | 128;
|
|
1198
|
+
} else
|
|
1199
|
+
while (tmp1_flag) {
|
|
1200
|
+
tmp2_index = tmp12_input.nz(tmp0_desc);
|
|
1201
|
+
switch (tmp2_index) {
|
|
1202
|
+
case -1:
|
|
1203
|
+
tmp1_flag = false;
|
|
1204
|
+
break;
|
|
1205
|
+
case 0:
|
|
1206
|
+
tmp4_local0 = tmp12_input.gz(tmp0_desc, 0);
|
|
1207
|
+
tmp3_bitMask0 = tmp3_bitMask0 | 1;
|
|
1208
|
+
break;
|
|
1209
|
+
case 1:
|
|
1210
|
+
tmp5_local1 = tmp12_input.iz(tmp0_desc, 1, tmp13_cached[1].b1(), tmp5_local1);
|
|
1211
|
+
tmp3_bitMask0 = tmp3_bitMask0 | 2;
|
|
1212
|
+
break;
|
|
1213
|
+
case 2:
|
|
1214
|
+
tmp6_local2 = tmp12_input.kz(tmp0_desc, 2, tmp13_cached[2].b1(), tmp6_local2);
|
|
1215
|
+
tmp3_bitMask0 = tmp3_bitMask0 | 4;
|
|
1216
|
+
break;
|
|
1217
|
+
case 3:
|
|
1218
|
+
tmp7_local3 = tmp12_input.kz(tmp0_desc, 3, JsonElementSerializer_getInstance(), tmp7_local3);
|
|
1219
|
+
tmp3_bitMask0 = tmp3_bitMask0 | 8;
|
|
1220
|
+
break;
|
|
1221
|
+
case 4:
|
|
1222
|
+
tmp8_local4 = tmp12_input.kz(tmp0_desc, 4, $serializer_getInstance(), tmp8_local4);
|
|
1223
|
+
tmp3_bitMask0 = tmp3_bitMask0 | 16;
|
|
1224
|
+
break;
|
|
1225
|
+
case 5:
|
|
1226
|
+
tmp9_local5 = tmp12_input.yy(tmp0_desc, 5);
|
|
1227
|
+
tmp3_bitMask0 = tmp3_bitMask0 | 32;
|
|
1228
|
+
break;
|
|
1229
|
+
case 6:
|
|
1230
|
+
tmp10_local6 = tmp12_input.kz(tmp0_desc, 6, StringSerializer_getInstance(), tmp10_local6);
|
|
1231
|
+
tmp3_bitMask0 = tmp3_bitMask0 | 64;
|
|
1232
|
+
break;
|
|
1233
|
+
case 7:
|
|
1234
|
+
tmp11_local7 = tmp12_input.kz(tmp0_desc, 7, tmp13_cached[7].b1(), tmp11_local7);
|
|
1235
|
+
tmp3_bitMask0 = tmp3_bitMask0 | 128;
|
|
1236
|
+
break;
|
|
1237
|
+
default:
|
|
1238
|
+
throw UnknownFieldException_init_$Create$(tmp2_index);
|
|
1239
|
+
}
|
|
1240
|
+
}
|
|
1241
|
+
tmp12_input.xy(tmp0_desc);
|
|
1242
|
+
return OllamaChatRequestDTO_init_$Create$(tmp3_bitMask0, tmp4_local0, tmp5_local1, tmp6_local2, tmp7_local3, tmp8_local4, tmp9_local5, tmp10_local6, tmp11_local7, null);
|
|
1243
|
+
};
|
|
1244
|
+
protoOf($serializer_0).fv = function () {
|
|
1245
|
+
return this.z97_1;
|
|
1246
|
+
};
|
|
1247
|
+
protoOf($serializer_0).d17 = function () {
|
|
1248
|
+
var tmp0_cached = Companion_getInstance_3().u97_1;
|
|
1249
|
+
// Inline function 'kotlin.arrayOf' call
|
|
1250
|
+
// Inline function 'kotlin.js.unsafeCast' call
|
|
1251
|
+
// Inline function 'kotlin.js.asDynamic' call
|
|
1252
|
+
return [StringSerializer_getInstance(), tmp0_cached[1].b1(), get_nullable(tmp0_cached[2].b1()), get_nullable(JsonElementSerializer_getInstance()), get_nullable($serializer_getInstance()), BooleanSerializer_getInstance(), get_nullable(StringSerializer_getInstance()), get_nullable(tmp0_cached[7].b1())];
|
|
1253
|
+
};
|
|
1254
|
+
var $serializer_instance_0;
|
|
1255
|
+
function $serializer_getInstance_0() {
|
|
1256
|
+
if ($serializer_instance_0 == null)
|
|
1257
|
+
new $serializer_0();
|
|
1258
|
+
return $serializer_instance_0;
|
|
1259
|
+
}
|
|
1260
|
+
function OllamaChatRequestDTO_init_$Init$(seen0, model, messages, tools, format, options, stream, keepAlive, additionalProperties, serializationConstructorMarker, $this) {
|
|
1261
|
+
if (!(35 === (35 & seen0))) {
|
|
1262
|
+
throwMissingFieldException(seen0, 35, $serializer_getInstance_0().z97_1);
|
|
1263
|
+
}
|
|
1264
|
+
$this.b98_1 = model;
|
|
1265
|
+
$this.c98_1 = messages;
|
|
1266
|
+
if (0 === (seen0 & 4))
|
|
1267
|
+
$this.d98_1 = null;
|
|
1268
|
+
else
|
|
1269
|
+
$this.d98_1 = tools;
|
|
1270
|
+
if (0 === (seen0 & 8))
|
|
1271
|
+
$this.e98_1 = null;
|
|
1272
|
+
else
|
|
1273
|
+
$this.e98_1 = format;
|
|
1274
|
+
if (0 === (seen0 & 16))
|
|
1275
|
+
$this.f98_1 = null;
|
|
1276
|
+
else
|
|
1277
|
+
$this.f98_1 = options;
|
|
1278
|
+
$this.g98_1 = stream;
|
|
1279
|
+
if (0 === (seen0 & 64))
|
|
1280
|
+
$this.h98_1 = null;
|
|
1281
|
+
else
|
|
1282
|
+
$this.h98_1 = keepAlive;
|
|
1283
|
+
if (0 === (seen0 & 128))
|
|
1284
|
+
$this.i98_1 = null;
|
|
1285
|
+
else
|
|
1286
|
+
$this.i98_1 = additionalProperties;
|
|
1287
|
+
return $this;
|
|
1288
|
+
}
|
|
1289
|
+
function OllamaChatRequestDTO_init_$Create$(seen0, model, messages, tools, format, options, stream, keepAlive, additionalProperties, serializationConstructorMarker) {
|
|
1290
|
+
return OllamaChatRequestDTO_init_$Init$(seen0, model, messages, tools, format, options, stream, keepAlive, additionalProperties, serializationConstructorMarker, objectCreate(protoOf(OllamaChatRequestDTO)));
|
|
1291
|
+
}
|
|
1292
|
+
function OllamaChatRequestDTO(model, messages, tools, format, options, stream, keepAlive, additionalProperties) {
|
|
1293
|
+
Companion_getInstance_3();
|
|
1294
|
+
tools = tools === VOID ? null : tools;
|
|
1295
|
+
format = format === VOID ? null : format;
|
|
1296
|
+
options = options === VOID ? null : options;
|
|
1297
|
+
keepAlive = keepAlive === VOID ? null : keepAlive;
|
|
1298
|
+
additionalProperties = additionalProperties === VOID ? null : additionalProperties;
|
|
1299
|
+
this.b98_1 = model;
|
|
1300
|
+
this.c98_1 = messages;
|
|
1301
|
+
this.d98_1 = tools;
|
|
1302
|
+
this.e98_1 = format;
|
|
1303
|
+
this.f98_1 = options;
|
|
1304
|
+
this.g98_1 = stream;
|
|
1305
|
+
this.h98_1 = keepAlive;
|
|
1306
|
+
this.i98_1 = additionalProperties;
|
|
1307
|
+
}
|
|
1308
|
+
protoOf(OllamaChatRequestDTO).toString = function () {
|
|
1309
|
+
return 'OllamaChatRequestDTO(model=' + this.b98_1 + ', messages=' + toString(this.c98_1) + ', tools=' + toString_0(this.d98_1) + ', format=' + toString_0(this.e98_1) + ', options=' + toString_0(this.f98_1) + ', stream=' + this.g98_1 + ', keepAlive=' + this.h98_1 + ', additionalProperties=' + toString_0(this.i98_1) + ')';
|
|
1310
|
+
};
|
|
1311
|
+
protoOf(OllamaChatRequestDTO).hashCode = function () {
|
|
1312
|
+
var result = getStringHashCode(this.b98_1);
|
|
1313
|
+
result = imul(result, 31) + hashCode(this.c98_1) | 0;
|
|
1314
|
+
result = imul(result, 31) + (this.d98_1 == null ? 0 : hashCode(this.d98_1)) | 0;
|
|
1315
|
+
result = imul(result, 31) + (this.e98_1 == null ? 0 : hashCode(this.e98_1)) | 0;
|
|
1316
|
+
result = imul(result, 31) + (this.f98_1 == null ? 0 : this.f98_1.hashCode()) | 0;
|
|
1317
|
+
result = imul(result, 31) + getBooleanHashCode(this.g98_1) | 0;
|
|
1318
|
+
result = imul(result, 31) + (this.h98_1 == null ? 0 : getStringHashCode(this.h98_1)) | 0;
|
|
1319
|
+
result = imul(result, 31) + (this.i98_1 == null ? 0 : hashCode(this.i98_1)) | 0;
|
|
1320
|
+
return result;
|
|
1321
|
+
};
|
|
1322
|
+
protoOf(OllamaChatRequestDTO).equals = function (other) {
|
|
1323
|
+
if (this === other)
|
|
1324
|
+
return true;
|
|
1325
|
+
if (!(other instanceof OllamaChatRequestDTO))
|
|
1326
|
+
return false;
|
|
1327
|
+
var tmp0_other_with_cast = other instanceof OllamaChatRequestDTO ? other : THROW_CCE();
|
|
1328
|
+
if (!(this.b98_1 === tmp0_other_with_cast.b98_1))
|
|
1329
|
+
return false;
|
|
1330
|
+
if (!equals(this.c98_1, tmp0_other_with_cast.c98_1))
|
|
1331
|
+
return false;
|
|
1332
|
+
if (!equals(this.d98_1, tmp0_other_with_cast.d98_1))
|
|
1333
|
+
return false;
|
|
1334
|
+
if (!equals(this.e98_1, tmp0_other_with_cast.e98_1))
|
|
1335
|
+
return false;
|
|
1336
|
+
if (!equals(this.f98_1, tmp0_other_with_cast.f98_1))
|
|
1337
|
+
return false;
|
|
1338
|
+
if (!(this.g98_1 === tmp0_other_with_cast.g98_1))
|
|
1339
|
+
return false;
|
|
1340
|
+
if (!(this.h98_1 == tmp0_other_with_cast.h98_1))
|
|
1341
|
+
return false;
|
|
1342
|
+
if (!equals(this.i98_1, tmp0_other_with_cast.i98_1))
|
|
1343
|
+
return false;
|
|
1344
|
+
return true;
|
|
1345
|
+
};
|
|
1346
|
+
function OllamaChatMessageDTO$Companion$$childSerializers$_anonymous__2c2lck() {
|
|
1347
|
+
return new ArrayListSerializer(StringSerializer_getInstance());
|
|
1348
|
+
}
|
|
1349
|
+
function OllamaChatMessageDTO$Companion$$childSerializers$_anonymous__2c2lck_0() {
|
|
1350
|
+
return new ArrayListSerializer($serializer_getInstance_7());
|
|
1351
|
+
}
|
|
1352
|
+
function Companion_2() {
|
|
1353
|
+
Companion_instance_2 = this;
|
|
1354
|
+
var tmp = this;
|
|
1355
|
+
var tmp_0 = LazyThreadSafetyMode_PUBLICATION_getInstance();
|
|
1356
|
+
var tmp_1 = lazy(tmp_0, OllamaChatMessageDTO$Companion$$childSerializers$_anonymous__2c2lck);
|
|
1357
|
+
var tmp_2 = LazyThreadSafetyMode_PUBLICATION_getInstance();
|
|
1358
|
+
// Inline function 'kotlin.arrayOf' call
|
|
1359
|
+
// Inline function 'kotlin.js.unsafeCast' call
|
|
1360
|
+
// Inline function 'kotlin.js.asDynamic' call
|
|
1361
|
+
tmp.j98_1 = [null, null, tmp_1, lazy(tmp_2, OllamaChatMessageDTO$Companion$$childSerializers$_anonymous__2c2lck_0)];
|
|
1362
|
+
}
|
|
1363
|
+
var Companion_instance_2;
|
|
1364
|
+
function Companion_getInstance_4() {
|
|
1365
|
+
if (Companion_instance_2 == null)
|
|
1366
|
+
new Companion_2();
|
|
1367
|
+
return Companion_instance_2;
|
|
1368
|
+
}
|
|
1369
|
+
function $serializer_1() {
|
|
1370
|
+
$serializer_instance_1 = this;
|
|
1371
|
+
var tmp0_serialDesc = new PluginGeneratedSerialDescriptor('ai.koog.prompt.executor.ollama.client.dto.OllamaChatMessageDTO', this, 4);
|
|
1372
|
+
tmp0_serialDesc.m16('role', false);
|
|
1373
|
+
tmp0_serialDesc.m16('content', false);
|
|
1374
|
+
tmp0_serialDesc.m16('images', true);
|
|
1375
|
+
tmp0_serialDesc.m16('tool_calls', true);
|
|
1376
|
+
this.k98_1 = tmp0_serialDesc;
|
|
1377
|
+
}
|
|
1378
|
+
protoOf($serializer_1).l98 = function (encoder, value) {
|
|
1379
|
+
var tmp0_desc = this.k98_1;
|
|
1380
|
+
var tmp1_output = encoder.wy(tmp0_desc);
|
|
1381
|
+
var tmp2_cached = Companion_getInstance_4().j98_1;
|
|
1382
|
+
tmp1_output.l10(tmp0_desc, 0, value.k94_1);
|
|
1383
|
+
tmp1_output.l10(tmp0_desc, 1, value.l94_1);
|
|
1384
|
+
if (tmp1_output.t10(tmp0_desc, 2) ? true : !(value.m94_1 == null)) {
|
|
1385
|
+
tmp1_output.p10(tmp0_desc, 2, tmp2_cached[2].b1(), value.m94_1);
|
|
1386
|
+
}
|
|
1387
|
+
if (tmp1_output.t10(tmp0_desc, 3) ? true : !(value.n94_1 == null)) {
|
|
1388
|
+
tmp1_output.p10(tmp0_desc, 3, tmp2_cached[3].b1(), value.n94_1);
|
|
1389
|
+
}
|
|
1390
|
+
tmp1_output.xy(tmp0_desc);
|
|
1391
|
+
};
|
|
1392
|
+
protoOf($serializer_1).gv = function (encoder, value) {
|
|
1393
|
+
return this.l98(encoder, value instanceof OllamaChatMessageDTO ? value : THROW_CCE());
|
|
1394
|
+
};
|
|
1395
|
+
protoOf($serializer_1).hv = function (decoder) {
|
|
1396
|
+
var tmp0_desc = this.k98_1;
|
|
1397
|
+
var tmp1_flag = true;
|
|
1398
|
+
var tmp2_index = 0;
|
|
1399
|
+
var tmp3_bitMask0 = 0;
|
|
1400
|
+
var tmp4_local0 = null;
|
|
1401
|
+
var tmp5_local1 = null;
|
|
1402
|
+
var tmp6_local2 = null;
|
|
1403
|
+
var tmp7_local3 = null;
|
|
1404
|
+
var tmp8_input = decoder.wy(tmp0_desc);
|
|
1405
|
+
var tmp9_cached = Companion_getInstance_4().j98_1;
|
|
1406
|
+
if (tmp8_input.mz()) {
|
|
1407
|
+
tmp4_local0 = tmp8_input.gz(tmp0_desc, 0);
|
|
1408
|
+
tmp3_bitMask0 = tmp3_bitMask0 | 1;
|
|
1409
|
+
tmp5_local1 = tmp8_input.gz(tmp0_desc, 1);
|
|
1410
|
+
tmp3_bitMask0 = tmp3_bitMask0 | 2;
|
|
1411
|
+
tmp6_local2 = tmp8_input.kz(tmp0_desc, 2, tmp9_cached[2].b1(), tmp6_local2);
|
|
1412
|
+
tmp3_bitMask0 = tmp3_bitMask0 | 4;
|
|
1413
|
+
tmp7_local3 = tmp8_input.kz(tmp0_desc, 3, tmp9_cached[3].b1(), tmp7_local3);
|
|
1414
|
+
tmp3_bitMask0 = tmp3_bitMask0 | 8;
|
|
1415
|
+
} else
|
|
1416
|
+
while (tmp1_flag) {
|
|
1417
|
+
tmp2_index = tmp8_input.nz(tmp0_desc);
|
|
1418
|
+
switch (tmp2_index) {
|
|
1419
|
+
case -1:
|
|
1420
|
+
tmp1_flag = false;
|
|
1421
|
+
break;
|
|
1422
|
+
case 0:
|
|
1423
|
+
tmp4_local0 = tmp8_input.gz(tmp0_desc, 0);
|
|
1424
|
+
tmp3_bitMask0 = tmp3_bitMask0 | 1;
|
|
1425
|
+
break;
|
|
1426
|
+
case 1:
|
|
1427
|
+
tmp5_local1 = tmp8_input.gz(tmp0_desc, 1);
|
|
1428
|
+
tmp3_bitMask0 = tmp3_bitMask0 | 2;
|
|
1429
|
+
break;
|
|
1430
|
+
case 2:
|
|
1431
|
+
tmp6_local2 = tmp8_input.kz(tmp0_desc, 2, tmp9_cached[2].b1(), tmp6_local2);
|
|
1432
|
+
tmp3_bitMask0 = tmp3_bitMask0 | 4;
|
|
1433
|
+
break;
|
|
1434
|
+
case 3:
|
|
1435
|
+
tmp7_local3 = tmp8_input.kz(tmp0_desc, 3, tmp9_cached[3].b1(), tmp7_local3);
|
|
1436
|
+
tmp3_bitMask0 = tmp3_bitMask0 | 8;
|
|
1437
|
+
break;
|
|
1438
|
+
default:
|
|
1439
|
+
throw UnknownFieldException_init_$Create$(tmp2_index);
|
|
1440
|
+
}
|
|
1441
|
+
}
|
|
1442
|
+
tmp8_input.xy(tmp0_desc);
|
|
1443
|
+
return OllamaChatMessageDTO_init_$Create$(tmp3_bitMask0, tmp4_local0, tmp5_local1, tmp6_local2, tmp7_local3, null);
|
|
1444
|
+
};
|
|
1445
|
+
protoOf($serializer_1).fv = function () {
|
|
1446
|
+
return this.k98_1;
|
|
1447
|
+
};
|
|
1448
|
+
protoOf($serializer_1).d17 = function () {
|
|
1449
|
+
var tmp0_cached = Companion_getInstance_4().j98_1;
|
|
1450
|
+
// Inline function 'kotlin.arrayOf' call
|
|
1451
|
+
// Inline function 'kotlin.js.unsafeCast' call
|
|
1452
|
+
// Inline function 'kotlin.js.asDynamic' call
|
|
1453
|
+
return [StringSerializer_getInstance(), StringSerializer_getInstance(), get_nullable(tmp0_cached[2].b1()), get_nullable(tmp0_cached[3].b1())];
|
|
1454
|
+
};
|
|
1455
|
+
var $serializer_instance_1;
|
|
1456
|
+
function $serializer_getInstance_1() {
|
|
1457
|
+
if ($serializer_instance_1 == null)
|
|
1458
|
+
new $serializer_1();
|
|
1459
|
+
return $serializer_instance_1;
|
|
1460
|
+
}
|
|
1461
|
+
function OllamaChatMessageDTO_init_$Init$(seen0, role, content, images, toolCalls, serializationConstructorMarker, $this) {
|
|
1462
|
+
if (!(3 === (3 & seen0))) {
|
|
1463
|
+
throwMissingFieldException(seen0, 3, $serializer_getInstance_1().k98_1);
|
|
1464
|
+
}
|
|
1465
|
+
$this.k94_1 = role;
|
|
1466
|
+
$this.l94_1 = content;
|
|
1467
|
+
if (0 === (seen0 & 4))
|
|
1468
|
+
$this.m94_1 = null;
|
|
1469
|
+
else
|
|
1470
|
+
$this.m94_1 = images;
|
|
1471
|
+
if (0 === (seen0 & 8))
|
|
1472
|
+
$this.n94_1 = null;
|
|
1473
|
+
else
|
|
1474
|
+
$this.n94_1 = toolCalls;
|
|
1475
|
+
return $this;
|
|
1476
|
+
}
|
|
1477
|
+
function OllamaChatMessageDTO_init_$Create$(seen0, role, content, images, toolCalls, serializationConstructorMarker) {
|
|
1478
|
+
return OllamaChatMessageDTO_init_$Init$(seen0, role, content, images, toolCalls, serializationConstructorMarker, objectCreate(protoOf(OllamaChatMessageDTO)));
|
|
1479
|
+
}
|
|
1480
|
+
function OllamaChatMessageDTO(role, content, images, toolCalls) {
|
|
1481
|
+
Companion_getInstance_4();
|
|
1482
|
+
images = images === VOID ? null : images;
|
|
1483
|
+
toolCalls = toolCalls === VOID ? null : toolCalls;
|
|
1484
|
+
this.k94_1 = role;
|
|
1485
|
+
this.l94_1 = content;
|
|
1486
|
+
this.m94_1 = images;
|
|
1487
|
+
this.n94_1 = toolCalls;
|
|
1488
|
+
}
|
|
1489
|
+
protoOf(OllamaChatMessageDTO).toString = function () {
|
|
1490
|
+
return 'OllamaChatMessageDTO(role=' + this.k94_1 + ', content=' + this.l94_1 + ', images=' + toString_0(this.m94_1) + ', toolCalls=' + toString_0(this.n94_1) + ')';
|
|
1491
|
+
};
|
|
1492
|
+
protoOf(OllamaChatMessageDTO).hashCode = function () {
|
|
1493
|
+
var result = getStringHashCode(this.k94_1);
|
|
1494
|
+
result = imul(result, 31) + getStringHashCode(this.l94_1) | 0;
|
|
1495
|
+
result = imul(result, 31) + (this.m94_1 == null ? 0 : hashCode(this.m94_1)) | 0;
|
|
1496
|
+
result = imul(result, 31) + (this.n94_1 == null ? 0 : hashCode(this.n94_1)) | 0;
|
|
1497
|
+
return result;
|
|
1498
|
+
};
|
|
1499
|
+
protoOf(OllamaChatMessageDTO).equals = function (other) {
|
|
1500
|
+
if (this === other)
|
|
1501
|
+
return true;
|
|
1502
|
+
if (!(other instanceof OllamaChatMessageDTO))
|
|
1503
|
+
return false;
|
|
1504
|
+
var tmp0_other_with_cast = other instanceof OllamaChatMessageDTO ? other : THROW_CCE();
|
|
1505
|
+
if (!(this.k94_1 === tmp0_other_with_cast.k94_1))
|
|
1506
|
+
return false;
|
|
1507
|
+
if (!(this.l94_1 === tmp0_other_with_cast.l94_1))
|
|
1508
|
+
return false;
|
|
1509
|
+
if (!equals(this.m94_1, tmp0_other_with_cast.m94_1))
|
|
1510
|
+
return false;
|
|
1511
|
+
if (!equals(this.n94_1, tmp0_other_with_cast.n94_1))
|
|
1512
|
+
return false;
|
|
1513
|
+
return true;
|
|
1514
|
+
};
|
|
1515
|
+
function Companion_3() {
|
|
1516
|
+
}
|
|
1517
|
+
var Companion_instance_3;
|
|
1518
|
+
function Companion_getInstance_5() {
|
|
1519
|
+
return Companion_instance_3;
|
|
1520
|
+
}
|
|
1521
|
+
function $serializer_2() {
|
|
1522
|
+
$serializer_instance_2 = this;
|
|
1523
|
+
var tmp0_serialDesc = new PluginGeneratedSerialDescriptor('ai.koog.prompt.executor.ollama.client.dto.OllamaToolDTO.Definition', this, 3);
|
|
1524
|
+
tmp0_serialDesc.m16('name', false);
|
|
1525
|
+
tmp0_serialDesc.m16('description', false);
|
|
1526
|
+
tmp0_serialDesc.m16('parameters', false);
|
|
1527
|
+
this.m98_1 = tmp0_serialDesc;
|
|
1528
|
+
}
|
|
1529
|
+
protoOf($serializer_2).n98 = function (encoder, value) {
|
|
1530
|
+
var tmp0_desc = this.m98_1;
|
|
1531
|
+
var tmp1_output = encoder.wy(tmp0_desc);
|
|
1532
|
+
tmp1_output.l10(tmp0_desc, 0, value.o98_1);
|
|
1533
|
+
tmp1_output.l10(tmp0_desc, 1, value.p98_1);
|
|
1534
|
+
tmp1_output.n10(tmp0_desc, 2, JsonElementSerializer_getInstance(), value.q98_1);
|
|
1535
|
+
tmp1_output.xy(tmp0_desc);
|
|
1536
|
+
};
|
|
1537
|
+
protoOf($serializer_2).gv = function (encoder, value) {
|
|
1538
|
+
return this.n98(encoder, value instanceof Definition ? value : THROW_CCE());
|
|
1539
|
+
};
|
|
1540
|
+
protoOf($serializer_2).hv = function (decoder) {
|
|
1541
|
+
var tmp0_desc = this.m98_1;
|
|
1542
|
+
var tmp1_flag = true;
|
|
1543
|
+
var tmp2_index = 0;
|
|
1544
|
+
var tmp3_bitMask0 = 0;
|
|
1545
|
+
var tmp4_local0 = null;
|
|
1546
|
+
var tmp5_local1 = null;
|
|
1547
|
+
var tmp6_local2 = null;
|
|
1548
|
+
var tmp7_input = decoder.wy(tmp0_desc);
|
|
1549
|
+
if (tmp7_input.mz()) {
|
|
1550
|
+
tmp4_local0 = tmp7_input.gz(tmp0_desc, 0);
|
|
1551
|
+
tmp3_bitMask0 = tmp3_bitMask0 | 1;
|
|
1552
|
+
tmp5_local1 = tmp7_input.gz(tmp0_desc, 1);
|
|
1553
|
+
tmp3_bitMask0 = tmp3_bitMask0 | 2;
|
|
1554
|
+
tmp6_local2 = tmp7_input.iz(tmp0_desc, 2, JsonElementSerializer_getInstance(), tmp6_local2);
|
|
1555
|
+
tmp3_bitMask0 = tmp3_bitMask0 | 4;
|
|
1556
|
+
} else
|
|
1557
|
+
while (tmp1_flag) {
|
|
1558
|
+
tmp2_index = tmp7_input.nz(tmp0_desc);
|
|
1559
|
+
switch (tmp2_index) {
|
|
1560
|
+
case -1:
|
|
1561
|
+
tmp1_flag = false;
|
|
1562
|
+
break;
|
|
1563
|
+
case 0:
|
|
1564
|
+
tmp4_local0 = tmp7_input.gz(tmp0_desc, 0);
|
|
1565
|
+
tmp3_bitMask0 = tmp3_bitMask0 | 1;
|
|
1566
|
+
break;
|
|
1567
|
+
case 1:
|
|
1568
|
+
tmp5_local1 = tmp7_input.gz(tmp0_desc, 1);
|
|
1569
|
+
tmp3_bitMask0 = tmp3_bitMask0 | 2;
|
|
1570
|
+
break;
|
|
1571
|
+
case 2:
|
|
1572
|
+
tmp6_local2 = tmp7_input.iz(tmp0_desc, 2, JsonElementSerializer_getInstance(), tmp6_local2);
|
|
1573
|
+
tmp3_bitMask0 = tmp3_bitMask0 | 4;
|
|
1574
|
+
break;
|
|
1575
|
+
default:
|
|
1576
|
+
throw UnknownFieldException_init_$Create$(tmp2_index);
|
|
1577
|
+
}
|
|
1578
|
+
}
|
|
1579
|
+
tmp7_input.xy(tmp0_desc);
|
|
1580
|
+
return Definition_init_$Create$(tmp3_bitMask0, tmp4_local0, tmp5_local1, tmp6_local2, null);
|
|
1581
|
+
};
|
|
1582
|
+
protoOf($serializer_2).fv = function () {
|
|
1583
|
+
return this.m98_1;
|
|
1584
|
+
};
|
|
1585
|
+
protoOf($serializer_2).d17 = function () {
|
|
1586
|
+
// Inline function 'kotlin.arrayOf' call
|
|
1587
|
+
// Inline function 'kotlin.js.unsafeCast' call
|
|
1588
|
+
// Inline function 'kotlin.js.asDynamic' call
|
|
1589
|
+
return [StringSerializer_getInstance(), StringSerializer_getInstance(), JsonElementSerializer_getInstance()];
|
|
1590
|
+
};
|
|
1591
|
+
var $serializer_instance_2;
|
|
1592
|
+
function $serializer_getInstance_2() {
|
|
1593
|
+
if ($serializer_instance_2 == null)
|
|
1594
|
+
new $serializer_2();
|
|
1595
|
+
return $serializer_instance_2;
|
|
1596
|
+
}
|
|
1597
|
+
function Definition_init_$Init$(seen0, name, description, parameters, serializationConstructorMarker, $this) {
|
|
1598
|
+
if (!(7 === (7 & seen0))) {
|
|
1599
|
+
throwMissingFieldException(seen0, 7, $serializer_getInstance_2().m98_1);
|
|
1600
|
+
}
|
|
1601
|
+
$this.o98_1 = name;
|
|
1602
|
+
$this.p98_1 = description;
|
|
1603
|
+
$this.q98_1 = parameters;
|
|
1604
|
+
return $this;
|
|
1605
|
+
}
|
|
1606
|
+
function Definition_init_$Create$(seen0, name, description, parameters, serializationConstructorMarker) {
|
|
1607
|
+
return Definition_init_$Init$(seen0, name, description, parameters, serializationConstructorMarker, objectCreate(protoOf(Definition)));
|
|
1608
|
+
}
|
|
1609
|
+
function Definition(name, description, parameters) {
|
|
1610
|
+
this.o98_1 = name;
|
|
1611
|
+
this.p98_1 = description;
|
|
1612
|
+
this.q98_1 = parameters;
|
|
1613
|
+
}
|
|
1614
|
+
protoOf(Definition).toString = function () {
|
|
1615
|
+
return 'Definition(name=' + this.o98_1 + ', description=' + this.p98_1 + ', parameters=' + toString(this.q98_1) + ')';
|
|
1616
|
+
};
|
|
1617
|
+
protoOf(Definition).hashCode = function () {
|
|
1618
|
+
var result = getStringHashCode(this.o98_1);
|
|
1619
|
+
result = imul(result, 31) + getStringHashCode(this.p98_1) | 0;
|
|
1620
|
+
result = imul(result, 31) + hashCode(this.q98_1) | 0;
|
|
1621
|
+
return result;
|
|
1622
|
+
};
|
|
1623
|
+
protoOf(Definition).equals = function (other) {
|
|
1624
|
+
if (this === other)
|
|
1625
|
+
return true;
|
|
1626
|
+
if (!(other instanceof Definition))
|
|
1627
|
+
return false;
|
|
1628
|
+
var tmp0_other_with_cast = other instanceof Definition ? other : THROW_CCE();
|
|
1629
|
+
if (!(this.o98_1 === tmp0_other_with_cast.o98_1))
|
|
1630
|
+
return false;
|
|
1631
|
+
if (!(this.p98_1 === tmp0_other_with_cast.p98_1))
|
|
1632
|
+
return false;
|
|
1633
|
+
if (!equals(this.q98_1, tmp0_other_with_cast.q98_1))
|
|
1634
|
+
return false;
|
|
1635
|
+
return true;
|
|
1636
|
+
};
|
|
1637
|
+
function Companion_4() {
|
|
1638
|
+
}
|
|
1639
|
+
var Companion_instance_4;
|
|
1640
|
+
function Companion_getInstance_6() {
|
|
1641
|
+
return Companion_instance_4;
|
|
1642
|
+
}
|
|
1643
|
+
function $serializer_3() {
|
|
1644
|
+
$serializer_instance_3 = this;
|
|
1645
|
+
var tmp0_serialDesc = new PluginGeneratedSerialDescriptor('ai.koog.prompt.executor.ollama.client.dto.OllamaToolDTO', this, 2);
|
|
1646
|
+
tmp0_serialDesc.m16('type', false);
|
|
1647
|
+
tmp0_serialDesc.m16('function', false);
|
|
1648
|
+
this.r98_1 = tmp0_serialDesc;
|
|
1649
|
+
}
|
|
1650
|
+
protoOf($serializer_3).s98 = function (encoder, value) {
|
|
1651
|
+
var tmp0_desc = this.r98_1;
|
|
1652
|
+
var tmp1_output = encoder.wy(tmp0_desc);
|
|
1653
|
+
tmp1_output.l10(tmp0_desc, 0, value.t98_1);
|
|
1654
|
+
tmp1_output.n10(tmp0_desc, 1, $serializer_getInstance_2(), value.u98_1);
|
|
1655
|
+
tmp1_output.xy(tmp0_desc);
|
|
1656
|
+
};
|
|
1657
|
+
protoOf($serializer_3).gv = function (encoder, value) {
|
|
1658
|
+
return this.s98(encoder, value instanceof OllamaToolDTO ? value : THROW_CCE());
|
|
1659
|
+
};
|
|
1660
|
+
protoOf($serializer_3).hv = function (decoder) {
|
|
1661
|
+
var tmp0_desc = this.r98_1;
|
|
1662
|
+
var tmp1_flag = true;
|
|
1663
|
+
var tmp2_index = 0;
|
|
1664
|
+
var tmp3_bitMask0 = 0;
|
|
1665
|
+
var tmp4_local0 = null;
|
|
1666
|
+
var tmp5_local1 = null;
|
|
1667
|
+
var tmp6_input = decoder.wy(tmp0_desc);
|
|
1668
|
+
if (tmp6_input.mz()) {
|
|
1669
|
+
tmp4_local0 = tmp6_input.gz(tmp0_desc, 0);
|
|
1670
|
+
tmp3_bitMask0 = tmp3_bitMask0 | 1;
|
|
1671
|
+
tmp5_local1 = tmp6_input.iz(tmp0_desc, 1, $serializer_getInstance_2(), tmp5_local1);
|
|
1672
|
+
tmp3_bitMask0 = tmp3_bitMask0 | 2;
|
|
1673
|
+
} else
|
|
1674
|
+
while (tmp1_flag) {
|
|
1675
|
+
tmp2_index = tmp6_input.nz(tmp0_desc);
|
|
1676
|
+
switch (tmp2_index) {
|
|
1677
|
+
case -1:
|
|
1678
|
+
tmp1_flag = false;
|
|
1679
|
+
break;
|
|
1680
|
+
case 0:
|
|
1681
|
+
tmp4_local0 = tmp6_input.gz(tmp0_desc, 0);
|
|
1682
|
+
tmp3_bitMask0 = tmp3_bitMask0 | 1;
|
|
1683
|
+
break;
|
|
1684
|
+
case 1:
|
|
1685
|
+
tmp5_local1 = tmp6_input.iz(tmp0_desc, 1, $serializer_getInstance_2(), tmp5_local1);
|
|
1686
|
+
tmp3_bitMask0 = tmp3_bitMask0 | 2;
|
|
1687
|
+
break;
|
|
1688
|
+
default:
|
|
1689
|
+
throw UnknownFieldException_init_$Create$(tmp2_index);
|
|
1690
|
+
}
|
|
1691
|
+
}
|
|
1692
|
+
tmp6_input.xy(tmp0_desc);
|
|
1693
|
+
return OllamaToolDTO_init_$Create$(tmp3_bitMask0, tmp4_local0, tmp5_local1, null);
|
|
1694
|
+
};
|
|
1695
|
+
protoOf($serializer_3).fv = function () {
|
|
1696
|
+
return this.r98_1;
|
|
1697
|
+
};
|
|
1698
|
+
protoOf($serializer_3).d17 = function () {
|
|
1699
|
+
// Inline function 'kotlin.arrayOf' call
|
|
1700
|
+
// Inline function 'kotlin.js.unsafeCast' call
|
|
1701
|
+
// Inline function 'kotlin.js.asDynamic' call
|
|
1702
|
+
return [StringSerializer_getInstance(), $serializer_getInstance_2()];
|
|
1703
|
+
};
|
|
1704
|
+
var $serializer_instance_3;
|
|
1705
|
+
function $serializer_getInstance_3() {
|
|
1706
|
+
if ($serializer_instance_3 == null)
|
|
1707
|
+
new $serializer_3();
|
|
1708
|
+
return $serializer_instance_3;
|
|
1709
|
+
}
|
|
1710
|
+
function OllamaToolDTO_init_$Init$(seen0, type, function_0, serializationConstructorMarker, $this) {
|
|
1711
|
+
if (!(3 === (3 & seen0))) {
|
|
1712
|
+
throwMissingFieldException(seen0, 3, $serializer_getInstance_3().r98_1);
|
|
1713
|
+
}
|
|
1714
|
+
$this.t98_1 = type;
|
|
1715
|
+
$this.u98_1 = function_0;
|
|
1716
|
+
return $this;
|
|
1717
|
+
}
|
|
1718
|
+
function OllamaToolDTO_init_$Create$(seen0, type, function_0, serializationConstructorMarker) {
|
|
1719
|
+
return OllamaToolDTO_init_$Init$(seen0, type, function_0, serializationConstructorMarker, objectCreate(protoOf(OllamaToolDTO)));
|
|
1720
|
+
}
|
|
1721
|
+
function OllamaToolDTO(type, function_0) {
|
|
1722
|
+
this.t98_1 = type;
|
|
1723
|
+
this.u98_1 = function_0;
|
|
1724
|
+
}
|
|
1725
|
+
protoOf(OllamaToolDTO).toString = function () {
|
|
1726
|
+
return 'OllamaToolDTO(type=' + this.t98_1 + ', function=' + this.u98_1.toString() + ')';
|
|
1727
|
+
};
|
|
1728
|
+
protoOf(OllamaToolDTO).hashCode = function () {
|
|
1729
|
+
var result = getStringHashCode(this.t98_1);
|
|
1730
|
+
result = imul(result, 31) + this.u98_1.hashCode() | 0;
|
|
1731
|
+
return result;
|
|
1732
|
+
};
|
|
1733
|
+
protoOf(OllamaToolDTO).equals = function (other) {
|
|
1734
|
+
if (this === other)
|
|
1735
|
+
return true;
|
|
1736
|
+
if (!(other instanceof OllamaToolDTO))
|
|
1737
|
+
return false;
|
|
1738
|
+
var tmp0_other_with_cast = other instanceof OllamaToolDTO ? other : THROW_CCE();
|
|
1739
|
+
if (!(this.t98_1 === tmp0_other_with_cast.t98_1))
|
|
1740
|
+
return false;
|
|
1741
|
+
if (!this.u98_1.equals(tmp0_other_with_cast.u98_1))
|
|
1742
|
+
return false;
|
|
1743
|
+
return true;
|
|
1744
|
+
};
|
|
1745
|
+
function Companion_5() {
|
|
1746
|
+
}
|
|
1747
|
+
var Companion_instance_5;
|
|
1748
|
+
function Companion_getInstance_7() {
|
|
1749
|
+
return Companion_instance_5;
|
|
1750
|
+
}
|
|
1751
|
+
function $serializer_4() {
|
|
1752
|
+
$serializer_instance_4 = this;
|
|
1753
|
+
var tmp0_serialDesc = new PluginGeneratedSerialDescriptor('ai.koog.prompt.executor.ollama.client.dto.OllamaChatResponseDTO', this, 5);
|
|
1754
|
+
tmp0_serialDesc.m16('model', false);
|
|
1755
|
+
tmp0_serialDesc.m16('message', true);
|
|
1756
|
+
tmp0_serialDesc.m16('done', false);
|
|
1757
|
+
tmp0_serialDesc.m16('prompt_eval_count', true);
|
|
1758
|
+
tmp0_serialDesc.m16('eval_count', true);
|
|
1759
|
+
this.v98_1 = tmp0_serialDesc;
|
|
1760
|
+
}
|
|
1761
|
+
protoOf($serializer_4).w98 = function (encoder, value) {
|
|
1762
|
+
var tmp0_desc = this.v98_1;
|
|
1763
|
+
var tmp1_output = encoder.wy(tmp0_desc);
|
|
1764
|
+
tmp1_output.l10(tmp0_desc, 0, value.f94_1);
|
|
1765
|
+
if (tmp1_output.t10(tmp0_desc, 1) ? true : !(value.g94_1 == null)) {
|
|
1766
|
+
tmp1_output.p10(tmp0_desc, 1, $serializer_getInstance_1(), value.g94_1);
|
|
1767
|
+
}
|
|
1768
|
+
tmp1_output.d10(tmp0_desc, 2, value.h94_1);
|
|
1769
|
+
if (tmp1_output.t10(tmp0_desc, 3) ? true : !(value.i94_1 == null)) {
|
|
1770
|
+
tmp1_output.p10(tmp0_desc, 3, IntSerializer_getInstance(), value.i94_1);
|
|
1771
|
+
}
|
|
1772
|
+
if (tmp1_output.t10(tmp0_desc, 4) ? true : !(value.j94_1 == null)) {
|
|
1773
|
+
tmp1_output.p10(tmp0_desc, 4, IntSerializer_getInstance(), value.j94_1);
|
|
1774
|
+
}
|
|
1775
|
+
tmp1_output.xy(tmp0_desc);
|
|
1776
|
+
};
|
|
1777
|
+
protoOf($serializer_4).gv = function (encoder, value) {
|
|
1778
|
+
return this.w98(encoder, value instanceof OllamaChatResponseDTO ? value : THROW_CCE());
|
|
1779
|
+
};
|
|
1780
|
+
protoOf($serializer_4).hv = function (decoder) {
|
|
1781
|
+
var tmp0_desc = this.v98_1;
|
|
1782
|
+
var tmp1_flag = true;
|
|
1783
|
+
var tmp2_index = 0;
|
|
1784
|
+
var tmp3_bitMask0 = 0;
|
|
1785
|
+
var tmp4_local0 = null;
|
|
1786
|
+
var tmp5_local1 = null;
|
|
1787
|
+
var tmp6_local2 = false;
|
|
1788
|
+
var tmp7_local3 = null;
|
|
1789
|
+
var tmp8_local4 = null;
|
|
1790
|
+
var tmp9_input = decoder.wy(tmp0_desc);
|
|
1791
|
+
if (tmp9_input.mz()) {
|
|
1792
|
+
tmp4_local0 = tmp9_input.gz(tmp0_desc, 0);
|
|
1793
|
+
tmp3_bitMask0 = tmp3_bitMask0 | 1;
|
|
1794
|
+
tmp5_local1 = tmp9_input.kz(tmp0_desc, 1, $serializer_getInstance_1(), tmp5_local1);
|
|
1795
|
+
tmp3_bitMask0 = tmp3_bitMask0 | 2;
|
|
1796
|
+
tmp6_local2 = tmp9_input.yy(tmp0_desc, 2);
|
|
1797
|
+
tmp3_bitMask0 = tmp3_bitMask0 | 4;
|
|
1798
|
+
tmp7_local3 = tmp9_input.kz(tmp0_desc, 3, IntSerializer_getInstance(), tmp7_local3);
|
|
1799
|
+
tmp3_bitMask0 = tmp3_bitMask0 | 8;
|
|
1800
|
+
tmp8_local4 = tmp9_input.kz(tmp0_desc, 4, IntSerializer_getInstance(), tmp8_local4);
|
|
1801
|
+
tmp3_bitMask0 = tmp3_bitMask0 | 16;
|
|
1802
|
+
} else
|
|
1803
|
+
while (tmp1_flag) {
|
|
1804
|
+
tmp2_index = tmp9_input.nz(tmp0_desc);
|
|
1805
|
+
switch (tmp2_index) {
|
|
1806
|
+
case -1:
|
|
1807
|
+
tmp1_flag = false;
|
|
1808
|
+
break;
|
|
1809
|
+
case 0:
|
|
1810
|
+
tmp4_local0 = tmp9_input.gz(tmp0_desc, 0);
|
|
1811
|
+
tmp3_bitMask0 = tmp3_bitMask0 | 1;
|
|
1812
|
+
break;
|
|
1813
|
+
case 1:
|
|
1814
|
+
tmp5_local1 = tmp9_input.kz(tmp0_desc, 1, $serializer_getInstance_1(), tmp5_local1);
|
|
1815
|
+
tmp3_bitMask0 = tmp3_bitMask0 | 2;
|
|
1816
|
+
break;
|
|
1817
|
+
case 2:
|
|
1818
|
+
tmp6_local2 = tmp9_input.yy(tmp0_desc, 2);
|
|
1819
|
+
tmp3_bitMask0 = tmp3_bitMask0 | 4;
|
|
1820
|
+
break;
|
|
1821
|
+
case 3:
|
|
1822
|
+
tmp7_local3 = tmp9_input.kz(tmp0_desc, 3, IntSerializer_getInstance(), tmp7_local3);
|
|
1823
|
+
tmp3_bitMask0 = tmp3_bitMask0 | 8;
|
|
1824
|
+
break;
|
|
1825
|
+
case 4:
|
|
1826
|
+
tmp8_local4 = tmp9_input.kz(tmp0_desc, 4, IntSerializer_getInstance(), tmp8_local4);
|
|
1827
|
+
tmp3_bitMask0 = tmp3_bitMask0 | 16;
|
|
1828
|
+
break;
|
|
1829
|
+
default:
|
|
1830
|
+
throw UnknownFieldException_init_$Create$(tmp2_index);
|
|
1831
|
+
}
|
|
1832
|
+
}
|
|
1833
|
+
tmp9_input.xy(tmp0_desc);
|
|
1834
|
+
return OllamaChatResponseDTO_init_$Create$(tmp3_bitMask0, tmp4_local0, tmp5_local1, tmp6_local2, tmp7_local3, tmp8_local4, null);
|
|
1835
|
+
};
|
|
1836
|
+
protoOf($serializer_4).fv = function () {
|
|
1837
|
+
return this.v98_1;
|
|
1838
|
+
};
|
|
1839
|
+
protoOf($serializer_4).d17 = function () {
|
|
1840
|
+
// Inline function 'kotlin.arrayOf' call
|
|
1841
|
+
// Inline function 'kotlin.js.unsafeCast' call
|
|
1842
|
+
// Inline function 'kotlin.js.asDynamic' call
|
|
1843
|
+
return [StringSerializer_getInstance(), get_nullable($serializer_getInstance_1()), BooleanSerializer_getInstance(), get_nullable(IntSerializer_getInstance()), get_nullable(IntSerializer_getInstance())];
|
|
1844
|
+
};
|
|
1845
|
+
var $serializer_instance_4;
|
|
1846
|
+
function $serializer_getInstance_4() {
|
|
1847
|
+
if ($serializer_instance_4 == null)
|
|
1848
|
+
new $serializer_4();
|
|
1849
|
+
return $serializer_instance_4;
|
|
1850
|
+
}
|
|
1851
|
+
function OllamaChatResponseDTO_init_$Init$(seen0, model, message, done, promptEvalCount, evalCount, serializationConstructorMarker, $this) {
|
|
1852
|
+
if (!(5 === (5 & seen0))) {
|
|
1853
|
+
throwMissingFieldException(seen0, 5, $serializer_getInstance_4().v98_1);
|
|
1854
|
+
}
|
|
1855
|
+
$this.f94_1 = model;
|
|
1856
|
+
if (0 === (seen0 & 2))
|
|
1857
|
+
$this.g94_1 = null;
|
|
1858
|
+
else
|
|
1859
|
+
$this.g94_1 = message;
|
|
1860
|
+
$this.h94_1 = done;
|
|
1861
|
+
if (0 === (seen0 & 8))
|
|
1862
|
+
$this.i94_1 = null;
|
|
1863
|
+
else
|
|
1864
|
+
$this.i94_1 = promptEvalCount;
|
|
1865
|
+
if (0 === (seen0 & 16))
|
|
1866
|
+
$this.j94_1 = null;
|
|
1867
|
+
else
|
|
1868
|
+
$this.j94_1 = evalCount;
|
|
1869
|
+
return $this;
|
|
1870
|
+
}
|
|
1871
|
+
function OllamaChatResponseDTO_init_$Create$(seen0, model, message, done, promptEvalCount, evalCount, serializationConstructorMarker) {
|
|
1872
|
+
return OllamaChatResponseDTO_init_$Init$(seen0, model, message, done, promptEvalCount, evalCount, serializationConstructorMarker, objectCreate(protoOf(OllamaChatResponseDTO)));
|
|
1873
|
+
}
|
|
1874
|
+
function OllamaChatResponseDTO(model, message, done, promptEvalCount, evalCount) {
|
|
1875
|
+
message = message === VOID ? null : message;
|
|
1876
|
+
promptEvalCount = promptEvalCount === VOID ? null : promptEvalCount;
|
|
1877
|
+
evalCount = evalCount === VOID ? null : evalCount;
|
|
1878
|
+
this.f94_1 = model;
|
|
1879
|
+
this.g94_1 = message;
|
|
1880
|
+
this.h94_1 = done;
|
|
1881
|
+
this.i94_1 = promptEvalCount;
|
|
1882
|
+
this.j94_1 = evalCount;
|
|
1883
|
+
}
|
|
1884
|
+
protoOf(OllamaChatResponseDTO).toString = function () {
|
|
1885
|
+
return 'OllamaChatResponseDTO(model=' + this.f94_1 + ', message=' + toString_0(this.g94_1) + ', done=' + this.h94_1 + ', promptEvalCount=' + this.i94_1 + ', evalCount=' + this.j94_1 + ')';
|
|
1886
|
+
};
|
|
1887
|
+
protoOf(OllamaChatResponseDTO).hashCode = function () {
|
|
1888
|
+
var result = getStringHashCode(this.f94_1);
|
|
1889
|
+
result = imul(result, 31) + (this.g94_1 == null ? 0 : this.g94_1.hashCode()) | 0;
|
|
1890
|
+
result = imul(result, 31) + getBooleanHashCode(this.h94_1) | 0;
|
|
1891
|
+
result = imul(result, 31) + (this.i94_1 == null ? 0 : this.i94_1) | 0;
|
|
1892
|
+
result = imul(result, 31) + (this.j94_1 == null ? 0 : this.j94_1) | 0;
|
|
1893
|
+
return result;
|
|
1894
|
+
};
|
|
1895
|
+
protoOf(OllamaChatResponseDTO).equals = function (other) {
|
|
1896
|
+
if (this === other)
|
|
1897
|
+
return true;
|
|
1898
|
+
if (!(other instanceof OllamaChatResponseDTO))
|
|
1899
|
+
return false;
|
|
1900
|
+
var tmp0_other_with_cast = other instanceof OllamaChatResponseDTO ? other : THROW_CCE();
|
|
1901
|
+
if (!(this.f94_1 === tmp0_other_with_cast.f94_1))
|
|
1902
|
+
return false;
|
|
1903
|
+
if (!equals(this.g94_1, tmp0_other_with_cast.g94_1))
|
|
1904
|
+
return false;
|
|
1905
|
+
if (!(this.h94_1 === tmp0_other_with_cast.h94_1))
|
|
1906
|
+
return false;
|
|
1907
|
+
if (!(this.i94_1 == tmp0_other_with_cast.i94_1))
|
|
1908
|
+
return false;
|
|
1909
|
+
if (!(this.j94_1 == tmp0_other_with_cast.j94_1))
|
|
1910
|
+
return false;
|
|
1911
|
+
return true;
|
|
1912
|
+
};
|
|
1913
|
+
function Companion_6() {
|
|
1914
|
+
}
|
|
1915
|
+
var Companion_instance_6;
|
|
1916
|
+
function Companion_getInstance_8() {
|
|
1917
|
+
return Companion_instance_6;
|
|
1918
|
+
}
|
|
1919
|
+
function $serializer_5() {
|
|
1920
|
+
$serializer_instance_5 = this;
|
|
1921
|
+
var tmp0_serialDesc = new PluginGeneratedSerialDescriptor('ai.koog.prompt.executor.ollama.client.dto.OllamaErrorResponseDTO', this, 1);
|
|
1922
|
+
tmp0_serialDesc.m16('error', false);
|
|
1923
|
+
this.x98_1 = tmp0_serialDesc;
|
|
1924
|
+
}
|
|
1925
|
+
protoOf($serializer_5).y98 = function (encoder, value) {
|
|
1926
|
+
var tmp0_desc = this.x98_1;
|
|
1927
|
+
var tmp1_output = encoder.wy(tmp0_desc);
|
|
1928
|
+
tmp1_output.l10(tmp0_desc, 0, value.t94_1);
|
|
1929
|
+
tmp1_output.xy(tmp0_desc);
|
|
1930
|
+
};
|
|
1931
|
+
protoOf($serializer_5).gv = function (encoder, value) {
|
|
1932
|
+
return this.y98(encoder, value instanceof OllamaErrorResponseDTO ? value : THROW_CCE());
|
|
1933
|
+
};
|
|
1934
|
+
protoOf($serializer_5).hv = function (decoder) {
|
|
1935
|
+
var tmp0_desc = this.x98_1;
|
|
1936
|
+
var tmp1_flag = true;
|
|
1937
|
+
var tmp2_index = 0;
|
|
1938
|
+
var tmp3_bitMask0 = 0;
|
|
1939
|
+
var tmp4_local0 = null;
|
|
1940
|
+
var tmp5_input = decoder.wy(tmp0_desc);
|
|
1941
|
+
if (tmp5_input.mz()) {
|
|
1942
|
+
tmp4_local0 = tmp5_input.gz(tmp0_desc, 0);
|
|
1943
|
+
tmp3_bitMask0 = tmp3_bitMask0 | 1;
|
|
1944
|
+
} else
|
|
1945
|
+
while (tmp1_flag) {
|
|
1946
|
+
tmp2_index = tmp5_input.nz(tmp0_desc);
|
|
1947
|
+
switch (tmp2_index) {
|
|
1948
|
+
case -1:
|
|
1949
|
+
tmp1_flag = false;
|
|
1950
|
+
break;
|
|
1951
|
+
case 0:
|
|
1952
|
+
tmp4_local0 = tmp5_input.gz(tmp0_desc, 0);
|
|
1953
|
+
tmp3_bitMask0 = tmp3_bitMask0 | 1;
|
|
1954
|
+
break;
|
|
1955
|
+
default:
|
|
1956
|
+
throw UnknownFieldException_init_$Create$(tmp2_index);
|
|
1957
|
+
}
|
|
1958
|
+
}
|
|
1959
|
+
tmp5_input.xy(tmp0_desc);
|
|
1960
|
+
return OllamaErrorResponseDTO_init_$Create$(tmp3_bitMask0, tmp4_local0, null);
|
|
1961
|
+
};
|
|
1962
|
+
protoOf($serializer_5).fv = function () {
|
|
1963
|
+
return this.x98_1;
|
|
1964
|
+
};
|
|
1965
|
+
protoOf($serializer_5).d17 = function () {
|
|
1966
|
+
// Inline function 'kotlin.arrayOf' call
|
|
1967
|
+
// Inline function 'kotlin.js.unsafeCast' call
|
|
1968
|
+
// Inline function 'kotlin.js.asDynamic' call
|
|
1969
|
+
return [StringSerializer_getInstance()];
|
|
1970
|
+
};
|
|
1971
|
+
var $serializer_instance_5;
|
|
1972
|
+
function $serializer_getInstance_5() {
|
|
1973
|
+
if ($serializer_instance_5 == null)
|
|
1974
|
+
new $serializer_5();
|
|
1975
|
+
return $serializer_instance_5;
|
|
1976
|
+
}
|
|
1977
|
+
function OllamaErrorResponseDTO_init_$Init$(seen0, error, serializationConstructorMarker, $this) {
|
|
1978
|
+
if (!(1 === (1 & seen0))) {
|
|
1979
|
+
throwMissingFieldException(seen0, 1, $serializer_getInstance_5().x98_1);
|
|
1980
|
+
}
|
|
1981
|
+
$this.t94_1 = error;
|
|
1982
|
+
return $this;
|
|
1983
|
+
}
|
|
1984
|
+
function OllamaErrorResponseDTO_init_$Create$(seen0, error, serializationConstructorMarker) {
|
|
1985
|
+
return OllamaErrorResponseDTO_init_$Init$(seen0, error, serializationConstructorMarker, objectCreate(protoOf(OllamaErrorResponseDTO)));
|
|
1986
|
+
}
|
|
1987
|
+
function OllamaErrorResponseDTO(error) {
|
|
1988
|
+
this.t94_1 = error;
|
|
1989
|
+
}
|
|
1990
|
+
protoOf(OllamaErrorResponseDTO).toString = function () {
|
|
1991
|
+
return 'OllamaErrorResponseDTO(error=' + this.t94_1 + ')';
|
|
1992
|
+
};
|
|
1993
|
+
protoOf(OllamaErrorResponseDTO).hashCode = function () {
|
|
1994
|
+
return getStringHashCode(this.t94_1);
|
|
1995
|
+
};
|
|
1996
|
+
protoOf(OllamaErrorResponseDTO).equals = function (other) {
|
|
1997
|
+
if (this === other)
|
|
1998
|
+
return true;
|
|
1999
|
+
if (!(other instanceof OllamaErrorResponseDTO))
|
|
2000
|
+
return false;
|
|
2001
|
+
var tmp0_other_with_cast = other instanceof OllamaErrorResponseDTO ? other : THROW_CCE();
|
|
2002
|
+
if (!(this.t94_1 === tmp0_other_with_cast.t94_1))
|
|
2003
|
+
return false;
|
|
2004
|
+
return true;
|
|
2005
|
+
};
|
|
2006
|
+
function Companion_7() {
|
|
2007
|
+
}
|
|
2008
|
+
var Companion_instance_7;
|
|
2009
|
+
function Companion_getInstance_9() {
|
|
2010
|
+
return Companion_instance_7;
|
|
2011
|
+
}
|
|
2012
|
+
function $serializer_6() {
|
|
2013
|
+
$serializer_instance_6 = this;
|
|
2014
|
+
var tmp0_serialDesc = new PluginGeneratedSerialDescriptor('ai.koog.prompt.executor.ollama.client.dto.OllamaToolCallDTO.Call', this, 2);
|
|
2015
|
+
tmp0_serialDesc.m16('name', false);
|
|
2016
|
+
tmp0_serialDesc.m16('arguments', false);
|
|
2017
|
+
this.z98_1 = tmp0_serialDesc;
|
|
2018
|
+
}
|
|
2019
|
+
protoOf($serializer_6).a99 = function (encoder, value) {
|
|
2020
|
+
var tmp0_desc = this.z98_1;
|
|
2021
|
+
var tmp1_output = encoder.wy(tmp0_desc);
|
|
2022
|
+
tmp1_output.l10(tmp0_desc, 0, value.o96_1);
|
|
2023
|
+
tmp1_output.n10(tmp0_desc, 1, JsonElementSerializer_getInstance(), value.p96_1);
|
|
2024
|
+
tmp1_output.xy(tmp0_desc);
|
|
2025
|
+
};
|
|
2026
|
+
protoOf($serializer_6).gv = function (encoder, value) {
|
|
2027
|
+
return this.a99(encoder, value instanceof Call_0 ? value : THROW_CCE());
|
|
2028
|
+
};
|
|
2029
|
+
protoOf($serializer_6).hv = function (decoder) {
|
|
2030
|
+
var tmp0_desc = this.z98_1;
|
|
2031
|
+
var tmp1_flag = true;
|
|
2032
|
+
var tmp2_index = 0;
|
|
2033
|
+
var tmp3_bitMask0 = 0;
|
|
2034
|
+
var tmp4_local0 = null;
|
|
2035
|
+
var tmp5_local1 = null;
|
|
2036
|
+
var tmp6_input = decoder.wy(tmp0_desc);
|
|
2037
|
+
if (tmp6_input.mz()) {
|
|
2038
|
+
tmp4_local0 = tmp6_input.gz(tmp0_desc, 0);
|
|
2039
|
+
tmp3_bitMask0 = tmp3_bitMask0 | 1;
|
|
2040
|
+
tmp5_local1 = tmp6_input.iz(tmp0_desc, 1, JsonElementSerializer_getInstance(), tmp5_local1);
|
|
2041
|
+
tmp3_bitMask0 = tmp3_bitMask0 | 2;
|
|
2042
|
+
} else
|
|
2043
|
+
while (tmp1_flag) {
|
|
2044
|
+
tmp2_index = tmp6_input.nz(tmp0_desc);
|
|
2045
|
+
switch (tmp2_index) {
|
|
2046
|
+
case -1:
|
|
2047
|
+
tmp1_flag = false;
|
|
2048
|
+
break;
|
|
2049
|
+
case 0:
|
|
2050
|
+
tmp4_local0 = tmp6_input.gz(tmp0_desc, 0);
|
|
2051
|
+
tmp3_bitMask0 = tmp3_bitMask0 | 1;
|
|
2052
|
+
break;
|
|
2053
|
+
case 1:
|
|
2054
|
+
tmp5_local1 = tmp6_input.iz(tmp0_desc, 1, JsonElementSerializer_getInstance(), tmp5_local1);
|
|
2055
|
+
tmp3_bitMask0 = tmp3_bitMask0 | 2;
|
|
2056
|
+
break;
|
|
2057
|
+
default:
|
|
2058
|
+
throw UnknownFieldException_init_$Create$(tmp2_index);
|
|
2059
|
+
}
|
|
2060
|
+
}
|
|
2061
|
+
tmp6_input.xy(tmp0_desc);
|
|
2062
|
+
return Call_init_$Create$_0(tmp3_bitMask0, tmp4_local0, tmp5_local1, null);
|
|
2063
|
+
};
|
|
2064
|
+
protoOf($serializer_6).fv = function () {
|
|
2065
|
+
return this.z98_1;
|
|
2066
|
+
};
|
|
2067
|
+
protoOf($serializer_6).d17 = function () {
|
|
2068
|
+
// Inline function 'kotlin.arrayOf' call
|
|
2069
|
+
// Inline function 'kotlin.js.unsafeCast' call
|
|
2070
|
+
// Inline function 'kotlin.js.asDynamic' call
|
|
2071
|
+
return [StringSerializer_getInstance(), JsonElementSerializer_getInstance()];
|
|
2072
|
+
};
|
|
2073
|
+
var $serializer_instance_6;
|
|
2074
|
+
function $serializer_getInstance_6() {
|
|
2075
|
+
if ($serializer_instance_6 == null)
|
|
2076
|
+
new $serializer_6();
|
|
2077
|
+
return $serializer_instance_6;
|
|
2078
|
+
}
|
|
2079
|
+
function Call_init_$Init$(seen0, name, arguments_0, serializationConstructorMarker, $this) {
|
|
2080
|
+
if (!(3 === (3 & seen0))) {
|
|
2081
|
+
throwMissingFieldException(seen0, 3, $serializer_getInstance_6().z98_1);
|
|
2082
|
+
}
|
|
2083
|
+
$this.o96_1 = name;
|
|
2084
|
+
$this.p96_1 = arguments_0;
|
|
2085
|
+
return $this;
|
|
2086
|
+
}
|
|
2087
|
+
function Call_init_$Create$_0(seen0, name, arguments_0, serializationConstructorMarker) {
|
|
2088
|
+
return Call_init_$Init$(seen0, name, arguments_0, serializationConstructorMarker, objectCreate(protoOf(Call_0)));
|
|
2089
|
+
}
|
|
2090
|
+
function Call_0(name, arguments_0) {
|
|
2091
|
+
this.o96_1 = name;
|
|
2092
|
+
this.p96_1 = arguments_0;
|
|
2093
|
+
}
|
|
2094
|
+
protoOf(Call_0).toString = function () {
|
|
2095
|
+
return 'Call(name=' + this.o96_1 + ', arguments=' + toString(this.p96_1) + ')';
|
|
2096
|
+
};
|
|
2097
|
+
protoOf(Call_0).hashCode = function () {
|
|
2098
|
+
var result = getStringHashCode(this.o96_1);
|
|
2099
|
+
result = imul(result, 31) + hashCode(this.p96_1) | 0;
|
|
2100
|
+
return result;
|
|
2101
|
+
};
|
|
2102
|
+
protoOf(Call_0).equals = function (other) {
|
|
2103
|
+
if (this === other)
|
|
2104
|
+
return true;
|
|
2105
|
+
if (!(other instanceof Call_0))
|
|
2106
|
+
return false;
|
|
2107
|
+
var tmp0_other_with_cast = other instanceof Call_0 ? other : THROW_CCE();
|
|
2108
|
+
if (!(this.o96_1 === tmp0_other_with_cast.o96_1))
|
|
2109
|
+
return false;
|
|
2110
|
+
if (!equals(this.p96_1, tmp0_other_with_cast.p96_1))
|
|
2111
|
+
return false;
|
|
2112
|
+
return true;
|
|
2113
|
+
};
|
|
2114
|
+
function Companion_8() {
|
|
2115
|
+
}
|
|
2116
|
+
var Companion_instance_8;
|
|
2117
|
+
function Companion_getInstance_10() {
|
|
2118
|
+
return Companion_instance_8;
|
|
2119
|
+
}
|
|
2120
|
+
function $serializer_7() {
|
|
2121
|
+
$serializer_instance_7 = this;
|
|
2122
|
+
var tmp0_serialDesc = new PluginGeneratedSerialDescriptor('ai.koog.prompt.executor.ollama.client.dto.OllamaToolCallDTO', this, 1);
|
|
2123
|
+
tmp0_serialDesc.m16('function', false);
|
|
2124
|
+
this.b99_1 = tmp0_serialDesc;
|
|
2125
|
+
}
|
|
2126
|
+
protoOf($serializer_7).c99 = function (encoder, value) {
|
|
2127
|
+
var tmp0_desc = this.b99_1;
|
|
2128
|
+
var tmp1_output = encoder.wy(tmp0_desc);
|
|
2129
|
+
tmp1_output.n10(tmp0_desc, 0, $serializer_getInstance_6(), value.q96_1);
|
|
2130
|
+
tmp1_output.xy(tmp0_desc);
|
|
2131
|
+
};
|
|
2132
|
+
protoOf($serializer_7).gv = function (encoder, value) {
|
|
2133
|
+
return this.c99(encoder, value instanceof OllamaToolCallDTO ? value : THROW_CCE());
|
|
2134
|
+
};
|
|
2135
|
+
protoOf($serializer_7).hv = function (decoder) {
|
|
2136
|
+
var tmp0_desc = this.b99_1;
|
|
2137
|
+
var tmp1_flag = true;
|
|
2138
|
+
var tmp2_index = 0;
|
|
2139
|
+
var tmp3_bitMask0 = 0;
|
|
2140
|
+
var tmp4_local0 = null;
|
|
2141
|
+
var tmp5_input = decoder.wy(tmp0_desc);
|
|
2142
|
+
if (tmp5_input.mz()) {
|
|
2143
|
+
tmp4_local0 = tmp5_input.iz(tmp0_desc, 0, $serializer_getInstance_6(), tmp4_local0);
|
|
2144
|
+
tmp3_bitMask0 = tmp3_bitMask0 | 1;
|
|
2145
|
+
} else
|
|
2146
|
+
while (tmp1_flag) {
|
|
2147
|
+
tmp2_index = tmp5_input.nz(tmp0_desc);
|
|
2148
|
+
switch (tmp2_index) {
|
|
2149
|
+
case -1:
|
|
2150
|
+
tmp1_flag = false;
|
|
2151
|
+
break;
|
|
2152
|
+
case 0:
|
|
2153
|
+
tmp4_local0 = tmp5_input.iz(tmp0_desc, 0, $serializer_getInstance_6(), tmp4_local0);
|
|
2154
|
+
tmp3_bitMask0 = tmp3_bitMask0 | 1;
|
|
2155
|
+
break;
|
|
2156
|
+
default:
|
|
2157
|
+
throw UnknownFieldException_init_$Create$(tmp2_index);
|
|
2158
|
+
}
|
|
2159
|
+
}
|
|
2160
|
+
tmp5_input.xy(tmp0_desc);
|
|
2161
|
+
return OllamaToolCallDTO_init_$Create$(tmp3_bitMask0, tmp4_local0, null);
|
|
2162
|
+
};
|
|
2163
|
+
protoOf($serializer_7).fv = function () {
|
|
2164
|
+
return this.b99_1;
|
|
2165
|
+
};
|
|
2166
|
+
protoOf($serializer_7).d17 = function () {
|
|
2167
|
+
// Inline function 'kotlin.arrayOf' call
|
|
2168
|
+
// Inline function 'kotlin.js.unsafeCast' call
|
|
2169
|
+
// Inline function 'kotlin.js.asDynamic' call
|
|
2170
|
+
return [$serializer_getInstance_6()];
|
|
2171
|
+
};
|
|
2172
|
+
var $serializer_instance_7;
|
|
2173
|
+
function $serializer_getInstance_7() {
|
|
2174
|
+
if ($serializer_instance_7 == null)
|
|
2175
|
+
new $serializer_7();
|
|
2176
|
+
return $serializer_instance_7;
|
|
2177
|
+
}
|
|
2178
|
+
function OllamaToolCallDTO_init_$Init$(seen0, function_0, serializationConstructorMarker, $this) {
|
|
2179
|
+
if (!(1 === (1 & seen0))) {
|
|
2180
|
+
throwMissingFieldException(seen0, 1, $serializer_getInstance_7().b99_1);
|
|
2181
|
+
}
|
|
2182
|
+
$this.q96_1 = function_0;
|
|
2183
|
+
return $this;
|
|
2184
|
+
}
|
|
2185
|
+
function OllamaToolCallDTO_init_$Create$(seen0, function_0, serializationConstructorMarker) {
|
|
2186
|
+
return OllamaToolCallDTO_init_$Init$(seen0, function_0, serializationConstructorMarker, objectCreate(protoOf(OllamaToolCallDTO)));
|
|
2187
|
+
}
|
|
2188
|
+
function OllamaToolCallDTO(function_0) {
|
|
2189
|
+
this.q96_1 = function_0;
|
|
2190
|
+
}
|
|
2191
|
+
protoOf(OllamaToolCallDTO).toString = function () {
|
|
2192
|
+
return 'OllamaToolCallDTO(function=' + this.q96_1.toString() + ')';
|
|
2193
|
+
};
|
|
2194
|
+
protoOf(OllamaToolCallDTO).hashCode = function () {
|
|
2195
|
+
return this.q96_1.hashCode();
|
|
2196
|
+
};
|
|
2197
|
+
protoOf(OllamaToolCallDTO).equals = function (other) {
|
|
2198
|
+
if (this === other)
|
|
2199
|
+
return true;
|
|
2200
|
+
if (!(other instanceof OllamaToolCallDTO))
|
|
2201
|
+
return false;
|
|
2202
|
+
var tmp0_other_with_cast = other instanceof OllamaToolCallDTO ? other : THROW_CCE();
|
|
2203
|
+
if (!this.q96_1.equals(tmp0_other_with_cast.q96_1))
|
|
2204
|
+
return false;
|
|
2205
|
+
return true;
|
|
2206
|
+
};
|
|
2207
|
+
function toJSONSchema(_this__u8e3s4) {
|
|
2208
|
+
// Inline function 'kotlinx.serialization.json.buildJsonObject' call
|
|
2209
|
+
var builder = new JsonObjectBuilder();
|
|
2210
|
+
// Inline function 'kotlin.collections.map' call
|
|
2211
|
+
var this_0 = plus(_this__u8e3s4.t7y_1, _this__u8e3s4.u7y_1);
|
|
2212
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
2213
|
+
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
2214
|
+
var _iterator__ex2g4s = this_0.p();
|
|
2215
|
+
while (_iterator__ex2g4s.q()) {
|
|
2216
|
+
var item = _iterator__ex2g4s.r();
|
|
2217
|
+
var tmp$ret$0 = builder.g1k(item.v7y_1, toJSONSchema$toolParameterToSchema(item.x7y_1, item.w7y_1));
|
|
2218
|
+
destination.h(tmp$ret$0);
|
|
2219
|
+
}
|
|
2220
|
+
var properties = builder.s1i();
|
|
2221
|
+
// Inline function 'kotlinx.serialization.json.buildJsonObject' call
|
|
2222
|
+
var builder_0 = new JsonObjectBuilder();
|
|
2223
|
+
builder_0.g1k('title', JsonPrimitive(_this__u8e3s4.r7y_1));
|
|
2224
|
+
builder_0.g1k('description', JsonPrimitive(_this__u8e3s4.s7y_1));
|
|
2225
|
+
builder_0.g1k('type', JsonPrimitive('object'));
|
|
2226
|
+
builder_0.g1k('properties', new JsonObject(properties));
|
|
2227
|
+
// Inline function 'kotlin.collections.map' call
|
|
2228
|
+
var this_1 = _this__u8e3s4.t7y_1;
|
|
2229
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
2230
|
+
var destination_0 = ArrayList_init_$Create$(collectionSizeOrDefault(this_1, 10));
|
|
2231
|
+
var _iterator__ex2g4s_0 = this_1.p();
|
|
2232
|
+
while (_iterator__ex2g4s_0.q()) {
|
|
2233
|
+
var item_0 = _iterator__ex2g4s_0.r();
|
|
2234
|
+
var tmp$ret$5 = JsonPrimitive(item_0.v7y_1);
|
|
2235
|
+
destination_0.h(tmp$ret$5);
|
|
2236
|
+
}
|
|
2237
|
+
builder_0.g1k('required', new JsonArray(destination_0));
|
|
2238
|
+
var schemaJson = builder_0.s1i();
|
|
2239
|
+
return schemaJson;
|
|
2240
|
+
}
|
|
2241
|
+
function toJSONSchema$toolParameterToSchema(type, description) {
|
|
2242
|
+
description = description === VOID ? null : description;
|
|
2243
|
+
// Inline function 'kotlinx.serialization.json.buildJsonObject' call
|
|
2244
|
+
var builder = new JsonObjectBuilder();
|
|
2245
|
+
if (type instanceof String_0)
|
|
2246
|
+
put(builder, 'type', 'string');
|
|
2247
|
+
else {
|
|
2248
|
+
if (type instanceof Integer)
|
|
2249
|
+
put(builder, 'type', 'integer');
|
|
2250
|
+
else {
|
|
2251
|
+
if (type instanceof Float)
|
|
2252
|
+
put(builder, 'type', 'number');
|
|
2253
|
+
else {
|
|
2254
|
+
if (type instanceof Boolean_0)
|
|
2255
|
+
put(builder, 'type', 'boolean');
|
|
2256
|
+
else {
|
|
2257
|
+
if (type instanceof Enum) {
|
|
2258
|
+
// Inline function 'kotlin.collections.map' call
|
|
2259
|
+
var this_0 = type.n7z_1;
|
|
2260
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
2261
|
+
var destination = ArrayList_init_$Create$(this_0.length);
|
|
2262
|
+
var inductionVariable = 0;
|
|
2263
|
+
var last = this_0.length;
|
|
2264
|
+
while (inductionVariable < last) {
|
|
2265
|
+
var item = this_0[inductionVariable];
|
|
2266
|
+
inductionVariable = inductionVariable + 1 | 0;
|
|
2267
|
+
var tmp$ret$0 = JsonPrimitive(item);
|
|
2268
|
+
destination.h(tmp$ret$0);
|
|
2269
|
+
}
|
|
2270
|
+
var enumValues = destination;
|
|
2271
|
+
put(builder, 'type', 'string');
|
|
2272
|
+
builder.g1k('enum', new JsonArray(enumValues));
|
|
2273
|
+
} else {
|
|
2274
|
+
if (type instanceof List) {
|
|
2275
|
+
put(builder, 'type', 'array');
|
|
2276
|
+
builder.g1k('items', toJSONSchema$toolParameterToSchema(type.l7z_1));
|
|
2277
|
+
} else {
|
|
2278
|
+
if (type instanceof Object_0) {
|
|
2279
|
+
builder.g1k('type', JsonPrimitive('object'));
|
|
2280
|
+
// Inline function 'kotlinx.serialization.json.buildJsonObject' call
|
|
2281
|
+
var builder_0 = new JsonObjectBuilder();
|
|
2282
|
+
// Inline function 'kotlin.collections.forEach' call
|
|
2283
|
+
var _iterator__ex2g4s = type.h7z_1.p();
|
|
2284
|
+
while (_iterator__ex2g4s.q()) {
|
|
2285
|
+
var element = _iterator__ex2g4s.r();
|
|
2286
|
+
builder_0.g1k(element.v7y_1, toJSONSchema$toolParameterToSchema(element.x7y_1, element.w7y_1));
|
|
2287
|
+
}
|
|
2288
|
+
var tmp$ret$6 = builder_0.s1i();
|
|
2289
|
+
builder.g1k('properties', tmp$ret$6);
|
|
2290
|
+
// Inline function 'kotlin.collections.map' call
|
|
2291
|
+
var this_1 = type.i7z_1;
|
|
2292
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
2293
|
+
var destination_0 = ArrayList_init_$Create$(collectionSizeOrDefault(this_1, 10));
|
|
2294
|
+
var _iterator__ex2g4s_0 = this_1.p();
|
|
2295
|
+
while (_iterator__ex2g4s_0.q()) {
|
|
2296
|
+
var item_0 = _iterator__ex2g4s_0.r();
|
|
2297
|
+
var tmp$ret$7 = JsonPrimitive(item_0);
|
|
2298
|
+
destination_0.h(tmp$ret$7);
|
|
2299
|
+
}
|
|
2300
|
+
builder.g1k('required', new JsonArray(destination_0));
|
|
2301
|
+
} else {
|
|
2302
|
+
noWhenBranchMatchedException();
|
|
2303
|
+
}
|
|
2304
|
+
}
|
|
2305
|
+
}
|
|
2306
|
+
}
|
|
2307
|
+
}
|
|
2308
|
+
}
|
|
2309
|
+
}
|
|
2310
|
+
if (!(description == null)) {
|
|
2311
|
+
put(builder, 'description', description);
|
|
2312
|
+
}
|
|
2313
|
+
return builder.s1i();
|
|
2314
|
+
}
|
|
2315
|
+
//region block: post-declaration
|
|
2316
|
+
protoOf($serializer).e17 = typeParametersSerializers;
|
|
2317
|
+
protoOf($serializer_0).e17 = typeParametersSerializers;
|
|
2318
|
+
protoOf($serializer_1).e17 = typeParametersSerializers;
|
|
2319
|
+
protoOf($serializer_2).e17 = typeParametersSerializers;
|
|
2320
|
+
protoOf($serializer_3).e17 = typeParametersSerializers;
|
|
2321
|
+
protoOf($serializer_4).e17 = typeParametersSerializers;
|
|
2322
|
+
protoOf($serializer_5).e17 = typeParametersSerializers;
|
|
2323
|
+
protoOf($serializer_6).e17 = typeParametersSerializers;
|
|
2324
|
+
protoOf($serializer_7).e17 = typeParametersSerializers;
|
|
2325
|
+
//endregion
|
|
2326
|
+
//region block: init
|
|
2327
|
+
None_instance = new None();
|
|
2328
|
+
Companion_instance_0 = new Companion_0();
|
|
2329
|
+
Companion_instance_3 = new Companion_3();
|
|
2330
|
+
Companion_instance_4 = new Companion_4();
|
|
2331
|
+
Companion_instance_5 = new Companion_5();
|
|
2332
|
+
Companion_instance_6 = new Companion_6();
|
|
2333
|
+
Companion_instance_7 = new Companion_7();
|
|
2334
|
+
Companion_instance_8 = new Companion_8();
|
|
2335
|
+
//endregion
|
|
2336
|
+
//region block: exports
|
|
2337
|
+
_.$_$ = _.$_$ || {};
|
|
2338
|
+
_.$_$.a = OllamaClient;
|
|
2339
|
+
//endregion
|
|
2340
|
+
return _;
|
|
2341
|
+
}));
|
|
2342
|
+
|
|
2343
|
+
//# sourceMappingURL=koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-ollama-client.js.map
|