@nhtio/adk 1.20260607.2 → 1.20260609.1
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/CHANGELOG.md +230 -0
- package/batteries/embeddings/openai/adapter.cjs +1 -1
- package/batteries/embeddings/openai/adapter.mjs +1 -1
- package/batteries/embeddings/openai/exceptions.cjs +1 -1
- package/batteries/embeddings/openai/exceptions.mjs +1 -1
- package/batteries/embeddings/openai/types.d.ts +7 -0
- package/batteries/embeddings/webllm/adapter.cjs +1 -1
- package/batteries/embeddings/webllm/adapter.mjs +1 -1
- package/batteries/embeddings/webllm/exceptions.cjs +1 -1
- package/batteries/embeddings/webllm/exceptions.mjs +1 -1
- package/batteries/llm/chat_common/helpers.d.ts +165 -0
- package/batteries/llm/chat_common/types.d.ts +309 -0
- package/batteries/llm/index.d.ts +5 -0
- package/batteries/llm/ollama/adapter.cjs +736 -0
- package/batteries/llm/ollama/adapter.cjs.map +1 -0
- package/batteries/llm/ollama/adapter.d.ts +64 -0
- package/batteries/llm/ollama/adapter.mjs +734 -0
- package/batteries/llm/ollama/adapter.mjs.map +1 -0
- package/batteries/llm/ollama/exceptions.cjs +105 -0
- package/batteries/llm/ollama/exceptions.cjs.map +1 -0
- package/batteries/llm/ollama/exceptions.d.ts +112 -0
- package/batteries/llm/ollama/exceptions.mjs +96 -0
- package/batteries/llm/ollama/exceptions.mjs.map +1 -0
- package/batteries/llm/ollama/helpers.cjs +487 -0
- package/batteries/llm/ollama/helpers.cjs.map +1 -0
- package/batteries/llm/ollama/helpers.d.ts +158 -0
- package/batteries/llm/ollama/helpers.mjs +450 -0
- package/batteries/llm/ollama/helpers.mjs.map +1 -0
- package/batteries/llm/ollama/index.d.ts +29 -0
- package/batteries/llm/ollama/types.cjs +2 -0
- package/batteries/llm/ollama/types.d.ts +334 -0
- package/batteries/llm/ollama/types.mjs +0 -0
- package/batteries/llm/ollama/validation.cjs +130 -0
- package/batteries/llm/ollama/validation.cjs.map +1 -0
- package/batteries/llm/ollama/validation.d.ts +31 -0
- package/batteries/llm/ollama/validation.mjs +127 -0
- package/batteries/llm/ollama/validation.mjs.map +1 -0
- package/batteries/llm/ollama.cjs +54 -0
- package/batteries/llm/ollama.mjs +6 -0
- package/batteries/llm/openai_chat_completions/adapter.cjs +36 -19
- package/batteries/llm/openai_chat_completions/adapter.cjs.map +1 -1
- package/batteries/llm/openai_chat_completions/adapter.mjs +23 -6
- package/batteries/llm/openai_chat_completions/adapter.mjs.map +1 -1
- package/batteries/llm/openai_chat_completions/exceptions.cjs +1 -1
- package/batteries/llm/openai_chat_completions/exceptions.mjs +1 -1
- package/batteries/llm/openai_chat_completions/helpers.cjs +80 -320
- package/batteries/llm/openai_chat_completions/helpers.cjs.map +1 -1
- package/batteries/llm/openai_chat_completions/helpers.d.ts +68 -144
- package/batteries/llm/openai_chat_completions/helpers.mjs +40 -280
- package/batteries/llm/openai_chat_completions/helpers.mjs.map +1 -1
- package/batteries/llm/openai_chat_completions/types.d.ts +273 -181
- package/batteries/llm/openai_chat_completions/validation.cjs +2 -2
- package/batteries/llm/openai_chat_completions/validation.cjs.map +1 -1
- package/batteries/llm/openai_chat_completions/validation.mjs +2 -2
- package/batteries/llm/openai_chat_completions/validation.mjs.map +1 -1
- package/batteries/llm/openai_chat_completions.cjs +29 -28
- package/batteries/llm/openai_chat_completions.mjs +2 -1
- package/batteries/llm/webllm_chat_completions/adapter.cjs +38 -19
- package/batteries/llm/webllm_chat_completions/adapter.cjs.map +1 -1
- package/batteries/llm/webllm_chat_completions/adapter.d.ts +18 -0
- package/batteries/llm/webllm_chat_completions/adapter.mjs +25 -6
- package/batteries/llm/webllm_chat_completions/adapter.mjs.map +1 -1
- package/batteries/llm/webllm_chat_completions/exceptions.cjs +1 -1
- package/batteries/llm/webllm_chat_completions/exceptions.mjs +1 -1
- package/batteries/llm/webllm_chat_completions/helpers.cjs +29 -28
- package/batteries/llm/webllm_chat_completions/helpers.mjs +2 -1
- package/batteries/llm/webllm_chat_completions/types.d.ts +21 -0
- package/batteries/llm/webllm_chat_completions/validation.cjs +13 -1
- package/batteries/llm/webllm_chat_completions/validation.cjs.map +1 -1
- package/batteries/llm/webllm_chat_completions/validation.d.ts +12 -0
- package/batteries/llm/webllm_chat_completions/validation.mjs +13 -1
- package/batteries/llm/webllm_chat_completions/validation.mjs.map +1 -1
- package/batteries/llm/webllm_chat_completions.cjs +29 -28
- package/batteries/llm/webllm_chat_completions.mjs +2 -1
- package/batteries/llm.cjs +44 -28
- package/batteries/llm.mjs +9 -4
- package/batteries/storage/flydrive.cjs +1 -1
- package/batteries/storage/flydrive.mjs +1 -1
- package/batteries/storage/in_memory/index.d.ts +1 -1
- package/batteries/storage/in_memory.cjs +2 -2
- package/batteries/storage/in_memory.cjs.map +1 -1
- package/batteries/storage/in_memory.mjs +2 -2
- package/batteries/storage/in_memory.mjs.map +1 -1
- package/batteries/storage/opfs/index.d.ts +19 -0
- package/batteries/storage/opfs.cjs +1 -1
- package/batteries/storage/opfs.cjs.map +1 -1
- package/batteries/storage/opfs.mjs +1 -1
- package/batteries/storage/opfs.mjs.map +1 -1
- package/batteries/tools/_shared/index.d.ts +121 -0
- package/batteries/tools/_shared.cjs +157 -0
- package/batteries/tools/_shared.cjs.map +1 -0
- package/batteries/tools/_shared.mjs +149 -0
- package/batteries/tools/_shared.mjs.map +1 -0
- package/batteries/tools/color.cjs +3 -2
- package/batteries/tools/color.cjs.map +1 -1
- package/batteries/tools/color.mjs +3 -2
- package/batteries/tools/color.mjs.map +1 -1
- package/batteries/tools/comparison.cjs +4 -3
- package/batteries/tools/comparison.cjs.map +1 -1
- package/batteries/tools/comparison.mjs +4 -3
- package/batteries/tools/comparison.mjs.map +1 -1
- package/batteries/tools/data_structure.cjs +30 -10
- package/batteries/tools/data_structure.cjs.map +1 -1
- package/batteries/tools/data_structure.mjs +30 -10
- package/batteries/tools/data_structure.mjs.map +1 -1
- package/batteries/tools/datetime_extended.cjs +5 -10
- package/batteries/tools/datetime_extended.cjs.map +1 -1
- package/batteries/tools/datetime_extended.mjs +5 -10
- package/batteries/tools/datetime_extended.mjs.map +1 -1
- package/batteries/tools/datetime_math.cjs +2 -2
- package/batteries/tools/datetime_math.mjs +2 -2
- package/batteries/tools/encoding.cjs +13 -4
- package/batteries/tools/encoding.cjs.map +1 -1
- package/batteries/tools/encoding.mjs +13 -4
- package/batteries/tools/encoding.mjs.map +1 -1
- package/batteries/tools/formatting.cjs +4 -4
- package/batteries/tools/formatting.cjs.map +1 -1
- package/batteries/tools/formatting.mjs +4 -4
- package/batteries/tools/formatting.mjs.map +1 -1
- package/batteries/tools/geo_basics.cjs +2 -2
- package/batteries/tools/geo_basics.mjs +2 -2
- package/batteries/tools/index.d.ts +3 -0
- package/batteries/tools/math.cjs +10 -8
- package/batteries/tools/math.cjs.map +1 -1
- package/batteries/tools/math.mjs +10 -8
- package/batteries/tools/math.mjs.map +1 -1
- package/batteries/tools/memory.cjs +5 -5
- package/batteries/tools/memory.mjs +5 -5
- package/batteries/tools/parsing.cjs +9 -5
- package/batteries/tools/parsing.cjs.map +1 -1
- package/batteries/tools/parsing.mjs +9 -5
- package/batteries/tools/parsing.mjs.map +1 -1
- package/batteries/tools/retrievables.cjs +4 -4
- package/batteries/tools/retrievables.mjs +4 -4
- package/batteries/tools/scrapper/exceptions.d.ts +21 -0
- package/batteries/tools/scrapper/index.d.ts +172 -0
- package/batteries/tools/scrapper/shared.d.ts +139 -0
- package/batteries/tools/scrapper.cjs +8 -0
- package/batteries/tools/scrapper.mjs +2 -0
- package/batteries/tools/searxng/exceptions.d.ts +21 -0
- package/batteries/tools/searxng/index.d.ts +177 -0
- package/batteries/tools/searxng.cjs +6 -0
- package/batteries/tools/searxng.mjs +2 -0
- package/batteries/tools/standing_instructions.cjs +4 -4
- package/batteries/tools/standing_instructions.mjs +4 -4
- package/batteries/tools/statistics.cjs +54 -43
- package/batteries/tools/statistics.cjs.map +1 -1
- package/batteries/tools/statistics.mjs +54 -43
- package/batteries/tools/statistics.mjs.map +1 -1
- package/batteries/tools/string_processing.cjs +5 -5
- package/batteries/tools/string_processing.cjs.map +1 -1
- package/batteries/tools/string_processing.mjs +5 -5
- package/batteries/tools/string_processing.mjs.map +1 -1
- package/batteries/tools/structured_data.cjs +8 -13
- package/batteries/tools/structured_data.cjs.map +1 -1
- package/batteries/tools/structured_data.mjs +8 -13
- package/batteries/tools/structured_data.mjs.map +1 -1
- package/batteries/tools/text_analysis.cjs +3 -3
- package/batteries/tools/text_analysis.mjs +3 -3
- package/batteries/tools/text_comparison.cjs +2 -2
- package/batteries/tools/text_comparison.mjs +2 -2
- package/batteries/tools/time.cjs +2 -2
- package/batteries/tools/time.mjs +2 -2
- package/batteries/tools/unit_conversion.cjs +10 -8
- package/batteries/tools/unit_conversion.cjs.map +1 -1
- package/batteries/tools/unit_conversion.mjs +10 -8
- package/batteries/tools/unit_conversion.mjs.map +1 -1
- package/batteries/tools/web_retrieval/index.d.ts +186 -0
- package/batteries/tools/web_retrieval.cjs +206 -0
- package/batteries/tools/web_retrieval.cjs.map +1 -0
- package/batteries/tools/web_retrieval.mjs +201 -0
- package/batteries/tools/web_retrieval.mjs.map +1 -0
- package/batteries/tools.cjs +15 -0
- package/batteries/tools.mjs +4 -1
- package/batteries/vector/arangodb/index.d.ts +2 -0
- package/batteries/vector/arangodb.cjs +2 -1
- package/batteries/vector/arangodb.cjs.map +1 -1
- package/batteries/vector/arangodb.mjs +2 -1
- package/batteries/vector/arangodb.mjs.map +1 -1
- package/batteries/vector/builder.cjs +31 -0
- package/batteries/vector/builder.cjs.map +1 -1
- package/batteries/vector/builder.d.ts +58 -0
- package/batteries/vector/builder.mjs +31 -0
- package/batteries/vector/builder.mjs.map +1 -1
- package/batteries/vector/chroma/index.d.ts +4 -0
- package/batteries/vector/chroma.cjs +3 -0
- package/batteries/vector/chroma.cjs.map +1 -1
- package/batteries/vector/chroma.mjs +3 -0
- package/batteries/vector/chroma.mjs.map +1 -1
- package/batteries/vector/clickhouse/index.d.ts +2 -0
- package/batteries/vector/clickhouse.cjs +2 -1
- package/batteries/vector/clickhouse.cjs.map +1 -1
- package/batteries/vector/clickhouse.mjs +2 -1
- package/batteries/vector/clickhouse.mjs.map +1 -1
- package/batteries/vector/cloudflare/index.d.ts +2 -0
- package/batteries/vector/cloudflare.cjs +2 -1
- package/batteries/vector/cloudflare.cjs.map +1 -1
- package/batteries/vector/cloudflare.mjs +2 -1
- package/batteries/vector/cloudflare.mjs.map +1 -1
- package/batteries/vector/conformance/index.d.ts +22 -0
- package/batteries/vector/conformance.cjs +22 -0
- package/batteries/vector/conformance.cjs.map +1 -1
- package/batteries/vector/conformance.mjs +22 -0
- package/batteries/vector/conformance.mjs.map +1 -1
- package/batteries/vector/contract.cjs +22 -0
- package/batteries/vector/contract.cjs.map +1 -1
- package/batteries/vector/contract.d.ts +51 -0
- package/batteries/vector/contract.mjs +22 -0
- package/batteries/vector/contract.mjs.map +1 -1
- package/batteries/vector/couchbase/index.d.ts +2 -0
- package/batteries/vector/couchbase.cjs +2 -1
- package/batteries/vector/couchbase.cjs.map +1 -1
- package/batteries/vector/couchbase.mjs +2 -1
- package/batteries/vector/couchbase.mjs.map +1 -1
- package/batteries/vector/duckdb/index.d.ts +2 -0
- package/batteries/vector/duckdb.cjs +2 -1
- package/batteries/vector/duckdb.cjs.map +1 -1
- package/batteries/vector/duckdb.mjs +2 -1
- package/batteries/vector/duckdb.mjs.map +1 -1
- package/batteries/vector/elasticsearch/index.d.ts +2 -0
- package/batteries/vector/elasticsearch.cjs +2 -1
- package/batteries/vector/elasticsearch.cjs.map +1 -1
- package/batteries/vector/elasticsearch.mjs +2 -1
- package/batteries/vector/elasticsearch.mjs.map +1 -1
- package/batteries/vector/exceptions.cjs +1 -1
- package/batteries/vector/exceptions.mjs +1 -1
- package/batteries/vector/factory.cjs +6 -0
- package/batteries/vector/factory.cjs.map +1 -1
- package/batteries/vector/factory.d.ts +14 -0
- package/batteries/vector/factory.mjs +6 -0
- package/batteries/vector/factory.mjs.map +1 -1
- package/batteries/vector/filters.cjs +22 -1
- package/batteries/vector/filters.cjs.map +1 -1
- package/batteries/vector/filters.d.ts +38 -0
- package/batteries/vector/filters.mjs +22 -1
- package/batteries/vector/filters.mjs.map +1 -1
- package/batteries/vector/helpers.cjs +13 -0
- package/batteries/vector/helpers.cjs.map +1 -1
- package/batteries/vector/helpers.d.ts +14 -0
- package/batteries/vector/helpers.mjs +13 -0
- package/batteries/vector/helpers.mjs.map +1 -1
- package/batteries/vector/hnswlib/index.d.ts +2 -0
- package/batteries/vector/hnswlib.cjs +2 -1
- package/batteries/vector/hnswlib.cjs.map +1 -1
- package/batteries/vector/hnswlib.mjs +2 -1
- package/batteries/vector/hnswlib.mjs.map +1 -1
- package/batteries/vector/in_memory/index.d.ts +1 -0
- package/batteries/vector/in_memory.cjs +1 -0
- package/batteries/vector/in_memory.cjs.map +1 -1
- package/batteries/vector/in_memory.mjs +1 -0
- package/batteries/vector/in_memory.mjs.map +1 -1
- package/batteries/vector/lancedb/index.d.ts +2 -0
- package/batteries/vector/lancedb.cjs +2 -1
- package/batteries/vector/lancedb.cjs.map +1 -1
- package/batteries/vector/lancedb.mjs +2 -1
- package/batteries/vector/lancedb.mjs.map +1 -1
- package/batteries/vector/mariadb/index.d.ts +2 -0
- package/batteries/vector/mariadb.cjs +2 -1
- package/batteries/vector/mariadb.cjs.map +1 -1
- package/batteries/vector/mariadb.mjs +2 -1
- package/batteries/vector/mariadb.mjs.map +1 -1
- package/batteries/vector/meilisearch/index.d.ts +2 -0
- package/batteries/vector/meilisearch.cjs +2 -1
- package/batteries/vector/meilisearch.cjs.map +1 -1
- package/batteries/vector/meilisearch.mjs +2 -1
- package/batteries/vector/meilisearch.mjs.map +1 -1
- package/batteries/vector/migrate.cjs +18 -1
- package/batteries/vector/migrate.cjs.map +1 -1
- package/batteries/vector/migrate.d.ts +31 -0
- package/batteries/vector/migrate.mjs +18 -1
- package/batteries/vector/migrate.mjs.map +1 -1
- package/batteries/vector/milvus/index.d.ts +5 -0
- package/batteries/vector/milvus.cjs +4 -0
- package/batteries/vector/milvus.cjs.map +1 -1
- package/batteries/vector/milvus.mjs +4 -0
- package/batteries/vector/milvus.mjs.map +1 -1
- package/batteries/vector/mongodb/index.d.ts +2 -0
- package/batteries/vector/mongodb.cjs +2 -1
- package/batteries/vector/mongodb.cjs.map +1 -1
- package/batteries/vector/mongodb.mjs +2 -1
- package/batteries/vector/mongodb.mjs.map +1 -1
- package/batteries/vector/neo4j/index.d.ts +2 -0
- package/batteries/vector/neo4j.cjs +2 -1
- package/batteries/vector/neo4j.cjs.map +1 -1
- package/batteries/vector/neo4j.mjs +2 -1
- package/batteries/vector/neo4j.mjs.map +1 -1
- package/batteries/vector/opensearch/index.d.ts +2 -0
- package/batteries/vector/opensearch.cjs +2 -1
- package/batteries/vector/opensearch.cjs.map +1 -1
- package/batteries/vector/opensearch.mjs +2 -1
- package/batteries/vector/opensearch.mjs.map +1 -1
- package/batteries/vector/oracle23ai/index.d.ts +2 -0
- package/batteries/vector/oracle23ai.cjs +2 -1
- package/batteries/vector/oracle23ai.cjs.map +1 -1
- package/batteries/vector/oracle23ai.mjs +2 -1
- package/batteries/vector/oracle23ai.mjs.map +1 -1
- package/batteries/vector/orama/index.d.ts +1 -0
- package/batteries/vector/orama.cjs +1 -0
- package/batteries/vector/orama.cjs.map +1 -1
- package/batteries/vector/orama.mjs +1 -0
- package/batteries/vector/orama.mjs.map +1 -1
- package/batteries/vector/pgvector/index.d.ts +9 -2
- package/batteries/vector/pgvector.cjs +4 -0
- package/batteries/vector/pgvector.cjs.map +1 -1
- package/batteries/vector/pgvector.mjs +4 -0
- package/batteries/vector/pgvector.mjs.map +1 -1
- package/batteries/vector/pinecone/index.d.ts +5 -0
- package/batteries/vector/pinecone.cjs +3 -1
- package/batteries/vector/pinecone.cjs.map +1 -1
- package/batteries/vector/pinecone.mjs +3 -1
- package/batteries/vector/pinecone.mjs.map +1 -1
- package/batteries/vector/plan.d.ts +27 -0
- package/batteries/vector/qdrant/index.d.ts +5 -0
- package/batteries/vector/qdrant.cjs +4 -0
- package/batteries/vector/qdrant.cjs.map +1 -1
- package/batteries/vector/qdrant.mjs +4 -0
- package/batteries/vector/qdrant.mjs.map +1 -1
- package/batteries/vector/redis/index.d.ts +2 -0
- package/batteries/vector/redis.cjs +2 -1
- package/batteries/vector/redis.cjs.map +1 -1
- package/batteries/vector/redis.mjs +2 -1
- package/batteries/vector/redis.mjs.map +1 -1
- package/batteries/vector/retrievable.cjs +9 -1
- package/batteries/vector/retrievable.cjs.map +1 -1
- package/batteries/vector/retrievable.mjs +9 -1
- package/batteries/vector/retrievable.mjs.map +1 -1
- package/batteries/vector/retrievable_glue.d.ts +21 -0
- package/batteries/vector/s3vectors/index.d.ts +2 -0
- package/batteries/vector/s3vectors.cjs +2 -1
- package/batteries/vector/s3vectors.cjs.map +1 -1
- package/batteries/vector/s3vectors.mjs +2 -1
- package/batteries/vector/s3vectors.mjs.map +1 -1
- package/batteries/vector/schema.cjs +28 -0
- package/batteries/vector/schema.cjs.map +1 -1
- package/batteries/vector/schema.d.ts +39 -0
- package/batteries/vector/schema.mjs +28 -0
- package/batteries/vector/schema.mjs.map +1 -1
- package/batteries/vector/solr/index.d.ts +2 -0
- package/batteries/vector/solr.cjs +2 -1
- package/batteries/vector/solr.cjs.map +1 -1
- package/batteries/vector/solr.mjs +2 -1
- package/batteries/vector/solr.mjs.map +1 -1
- package/batteries/vector/sqlite_vec/index.d.ts +6 -3
- package/batteries/vector/sqlite_vec.cjs +2 -0
- package/batteries/vector/sqlite_vec.cjs.map +1 -1
- package/batteries/vector/sqlite_vec.mjs +2 -0
- package/batteries/vector/sqlite_vec.mjs.map +1 -1
- package/batteries/vector/surrealdb/index.d.ts +2 -0
- package/batteries/vector/surrealdb.cjs +2 -1
- package/batteries/vector/surrealdb.cjs.map +1 -1
- package/batteries/vector/surrealdb.mjs +2 -1
- package/batteries/vector/surrealdb.mjs.map +1 -1
- package/batteries/vector/types.d.ts +27 -0
- package/batteries/vector/typesense/index.d.ts +2 -0
- package/batteries/vector/typesense.cjs +2 -1
- package/batteries/vector/typesense.cjs.map +1 -1
- package/batteries/vector/typesense.mjs +2 -1
- package/batteries/vector/typesense.mjs.map +1 -1
- package/batteries/vector/validation.cjs +14 -0
- package/batteries/vector/validation.cjs.map +1 -1
- package/batteries/vector/validation.d.ts +14 -0
- package/batteries/vector/validation.mjs +14 -0
- package/batteries/vector/validation.mjs.map +1 -1
- package/batteries/vector/vector_store_constructor.cjs +1 -1
- package/batteries/vector/vector_store_constructor.cjs.map +1 -1
- package/batteries/vector/vector_store_constructor.d.ts +1 -1
- package/batteries/vector/vector_store_constructor.mjs +1 -1
- package/batteries/vector/vector_store_constructor.mjs.map +1 -1
- package/batteries/vector/vespa/index.d.ts +2 -0
- package/batteries/vector/vespa.cjs +2 -1
- package/batteries/vector/vespa.cjs.map +1 -1
- package/batteries/vector/vespa.mjs +2 -1
- package/batteries/vector/vespa.mjs.map +1 -1
- package/batteries/vector/weaviate/index.d.ts +2 -0
- package/batteries/vector/weaviate.cjs +2 -1
- package/batteries/vector/weaviate.cjs.map +1 -1
- package/batteries/vector/weaviate.mjs +2 -1
- package/batteries/vector/weaviate.mjs.map +1 -1
- package/batteries.cjs +58 -28
- package/batteries.mjs +12 -5
- package/{common-BT0nfCi9.mjs → common-DYDUi99O.mjs} +9 -9
- package/common-DYDUi99O.mjs.map +1 -0
- package/{common-Cj8TaQ9U.js → common-DZl3ADJs.js} +9 -9
- package/common-DZl3ADJs.js.map +1 -0
- package/common.cjs +7 -7
- package/common.mjs +7 -7
- package/{dispatch_runner-DPcS7Y_M.mjs → dispatch_runner--ZhdDWRZ.mjs} +27 -5
- package/{dispatch_runner-DPcS7Y_M.mjs.map → dispatch_runner--ZhdDWRZ.mjs.map} +1 -1
- package/{dispatch_runner-BHBNupqp.js → dispatch_runner-nHDKkxye.js} +27 -5
- package/{dispatch_runner-BHBNupqp.js.map → dispatch_runner-nHDKkxye.js.map} +1 -1
- package/dispatch_runner.cjs +1 -1
- package/dispatch_runner.d.ts +1 -1
- package/dispatch_runner.mjs +1 -1
- package/eslint/rules/artifact_tool_forbids_artifact_constructor.cjs +1 -0
- package/eslint/rules/artifact_tool_forbids_artifact_constructor.cjs.map +1 -1
- package/eslint/rules/artifact_tool_forbids_artifact_constructor.d.ts +1 -0
- package/eslint/rules/artifact_tool_forbids_artifact_constructor.mjs +1 -0
- package/eslint/rules/artifact_tool_forbids_artifact_constructor.mjs.map +1 -1
- package/eslint/rules/no_model_in_tool_handler.cjs +1 -0
- package/eslint/rules/no_model_in_tool_handler.cjs.map +1 -1
- package/eslint/rules/no_model_in_tool_handler.d.ts +1 -0
- package/eslint/rules/no_model_in_tool_handler.mjs +1 -0
- package/eslint/rules/no_model_in_tool_handler.mjs.map +1 -1
- package/eslint/rules/require_validator_any_required.cjs +1 -0
- package/eslint/rules/require_validator_any_required.cjs.map +1 -1
- package/eslint/rules/require_validator_any_required.d.ts +1 -0
- package/eslint/rules/require_validator_any_required.mjs +1 -0
- package/eslint/rules/require_validator_any_required.mjs.map +1 -1
- package/eslint/rules/thought_payload_requires_replay_tag.cjs +1 -0
- package/eslint/rules/thought_payload_requires_replay_tag.cjs.map +1 -1
- package/eslint/rules/thought_payload_requires_replay_tag.d.ts +1 -0
- package/eslint/rules/thought_payload_requires_replay_tag.mjs +1 -0
- package/eslint/rules/thought_payload_requires_replay_tag.mjs.map +1 -1
- package/eslint/rules/token_encoding_requires_context_window.cjs +1 -0
- package/eslint/rules/token_encoding_requires_context_window.cjs.map +1 -1
- package/eslint/rules/token_encoding_requires_context_window.d.ts +1 -0
- package/eslint/rules/token_encoding_requires_context_window.mjs +1 -0
- package/eslint/rules/token_encoding_requires_context_window.mjs.map +1 -1
- package/eslint/rules.cjs +1 -1
- package/eslint/rules.mjs +1 -1
- package/eslint.cjs +2 -2
- package/eslint.mjs +2 -2
- package/{exceptions-BeWH2FwP.mjs → exceptions-BDhN0Xzr.mjs} +3 -2
- package/exceptions-BDhN0Xzr.mjs.map +1 -0
- package/{exceptions-CitH5wZI.js → exceptions-BRXrUKiW.js} +3 -2
- package/exceptions-BRXrUKiW.js.map +1 -0
- package/exceptions.cjs +2 -2
- package/exceptions.mjs +2 -2
- package/factories.cjs +1 -1
- package/factories.mjs +1 -1
- package/forge.cjs +4 -4
- package/forge.d.ts +1 -1
- package/forge.mjs +4 -4
- package/guards.cjs +9 -9
- package/guards.mjs +9 -9
- package/helpers-DSTFxTiC.js +497 -0
- package/helpers-DSTFxTiC.js.map +1 -0
- package/helpers-xhrQbMAG.mjs +306 -0
- package/helpers-xhrQbMAG.mjs.map +1 -0
- package/index.cjs +12 -12
- package/index.mjs +12 -12
- package/lib/classes/base_exception.d.ts +1 -0
- package/lib/classes/media.d.ts +10 -0
- package/lib/classes/retrievable.d.ts +1 -1
- package/lib/classes/spooled_json_artifact.d.ts +1 -1
- package/lib/classes/spooled_markdown_artifact.d.ts +1 -0
- package/lib/classes/tokenizable.d.ts +3 -0
- package/lib/classes/tool.d.ts +8 -0
- package/lib/classes/turn_gate.d.ts +6 -0
- package/lib/dispatch_runner.d.ts +4 -32
- package/lib/helpers/bignum.cjs +82 -0
- package/lib/helpers/bignum.cjs.map +1 -0
- package/lib/helpers/bignum.d.ts +52 -0
- package/lib/helpers/bignum.mjs +74 -0
- package/lib/helpers/bignum.mjs.map +1 -0
- package/lib/turn_runner.d.ts +1 -1
- package/lib/types/dispatch_runner.d.ts +83 -0
- package/lib/utils/exceptions.d.ts +1 -1
- package/lib/utils/retry.cjs.map +1 -1
- package/lib/utils/retry.d.ts +2 -0
- package/lib/utils/retry.mjs.map +1 -1
- package/mcp/adk-docs-corpus.json +1 -1
- package/package.json +259 -204
- package/{runtime-j92CNi5z.mjs → runtime-Bz5zA8wc.mjs} +2 -2
- package/{runtime-j92CNi5z.mjs.map → runtime-Bz5zA8wc.mjs.map} +1 -1
- package/{runtime-MFFcJrRv.js → runtime-DslE1aBw.js} +2 -2
- package/{runtime-MFFcJrRv.js.map → runtime-DslE1aBw.js.map} +1 -1
- package/scrapper-BHM1mCde.mjs +432 -0
- package/scrapper-BHM1mCde.mjs.map +1 -0
- package/scrapper-BeweWurk.js +462 -0
- package/scrapper-BeweWurk.js.map +1 -0
- package/searxng-BJFulNcK.mjs +247 -0
- package/searxng-BJFulNcK.mjs.map +1 -0
- package/searxng-B_D--V5q.js +265 -0
- package/searxng-B_D--V5q.js.map +1 -0
- package/skills/adk-assembly/SKILL.md +2 -2
- package/{spooled_artifact-CHoZgWwI.mjs → spooled_artifact-7eePq7JA.mjs} +5 -5
- package/{spooled_artifact-CHoZgWwI.mjs.map → spooled_artifact-7eePq7JA.mjs.map} +1 -1
- package/{spooled_artifact-BTq6Nzfy.js → spooled_artifact-DX8LLyUX.js} +5 -5
- package/{spooled_artifact-BTq6Nzfy.js.map → spooled_artifact-DX8LLyUX.js.map} +1 -1
- package/spooled_artifact.cjs +2 -2
- package/spooled_artifact.mjs +2 -2
- package/{spooled_markdown_artifact-CALSDxIx.js → spooled_markdown_artifact-ClX72lek.js} +4 -4
- package/spooled_markdown_artifact-ClX72lek.js.map +1 -0
- package/{spooled_markdown_artifact-Ci5UL7l4.mjs → spooled_markdown_artifact-wkrBF3oX.mjs} +4 -4
- package/spooled_markdown_artifact-wkrBF3oX.mjs.map +1 -0
- package/{thought-D34QQZZ9.mjs → thought-B_vxAiKU.mjs} +5 -5
- package/{thought-D34QQZZ9.mjs.map → thought-B_vxAiKU.mjs.map} +1 -1
- package/{thought-BbwhJ1wb.js → thought-DLwpF7MI.js} +5 -5
- package/{thought-BbwhJ1wb.js.map → thought-DLwpF7MI.js.map} +1 -1
- package/{tool-CVyZkFC7.js → tool-D5WGVIcI.js} +4 -4
- package/{tool-CVyZkFC7.js.map → tool-D5WGVIcI.js.map} +1 -1
- package/{tool-CMhaDRNd.mjs → tool-wMYMVl60.mjs} +4 -4
- package/{tool-CMhaDRNd.mjs.map → tool-wMYMVl60.mjs.map} +1 -1
- package/{tool_call-CV5qVNlb.mjs → tool_call-B4-_-vjG.mjs} +5 -5
- package/tool_call-B4-_-vjG.mjs.map +1 -0
- package/{tool_call-Db68hB7y.js → tool_call-DixVlW40.js} +5 -5
- package/tool_call-DixVlW40.js.map +1 -0
- package/{tool_registry-D1pSSlsd.mjs → tool_registry-791Vrjtf.mjs} +4 -3
- package/tool_registry-791Vrjtf.mjs.map +1 -0
- package/{tool_registry-DYUYqXvo.js → tool_registry-CKJPze3j.js} +4 -3
- package/tool_registry-CKJPze3j.js.map +1 -0
- package/{turn_runner-DqWHNP80.js → turn_runner-HXImLGIn.js} +7 -7
- package/turn_runner-HXImLGIn.js.map +1 -0
- package/{turn_runner-fg1Wc3dK.mjs → turn_runner-ZyYO-Kti.mjs} +7 -7
- package/turn_runner-ZyYO-Kti.mjs.map +1 -0
- package/turn_runner.cjs +1 -1
- package/turn_runner.mjs +1 -1
- package/types.d.ts +1 -1
- package/common-BT0nfCi9.mjs.map +0 -1
- package/common-Cj8TaQ9U.js.map +0 -1
- package/exceptions-BeWH2FwP.mjs.map +0 -1
- package/exceptions-CitH5wZI.js.map +0 -1
- package/spooled_markdown_artifact-CALSDxIx.js.map +0 -1
- package/spooled_markdown_artifact-Ci5UL7l4.mjs.map +0 -1
- package/tool_call-CV5qVNlb.mjs.map +0 -1
- package/tool_call-Db68hB7y.js.map +0 -1
- package/tool_registry-D1pSSlsd.mjs.map +0 -1
- package/tool_registry-DYUYqXvo.js.map +0 -1
- package/turn_runner-DqWHNP80.js.map +0 -1
- package/turn_runner-fg1Wc3dK.mjs.map +0 -1
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wire-shape-agnostic TypeScript types shared across the Chat-family LLM batteries.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* This module is INTERNAL to the bundled LLM batteries and is intentionally **not** tagged with
|
|
6
|
+
* an `@module` JSDoc directive — `bin/utils/index.ts` `getEntries` only mints a public package
|
|
7
|
+
* subpath for files that carry such a tag, so a tagless file stays private and is inlined into
|
|
8
|
+
* each consumer by the bundler (the same way `src/lib/utils/retry.ts` is shared, minus the public
|
|
9
|
+
* subpath). It holds the type aliases that the OpenAI Chat Completions battery and the native
|
|
10
|
+
* Ollama battery both need: the validator-description envelope, the JSON Schema subset, the
|
|
11
|
+
* trust-/memory-/retrievable-/thought-attribute envelopes, the system-prompt bucket ordering, the
|
|
12
|
+
* function-tool wire shape, the unsupported-media policy, the retry config, and the
|
|
13
|
+
* {@link ChatHelpersCommon} contract for the wire-shape-agnostic translation helpers.
|
|
14
|
+
*
|
|
15
|
+
* Battery-specific wire shapes (OpenAI Chat Completions message/chunk/response objects, the Ollama
|
|
16
|
+
* native message/chunk objects) live in each battery's own `types.ts`, not here.
|
|
17
|
+
*/
|
|
18
|
+
import type { Tokenizable, Memory, Thought, Retrievable, Tool, ArtifactTool } from "../../../common";
|
|
19
|
+
/**
|
|
20
|
+
* Structural shape of a validator/Joi `describe()` output, as consumed by the JSON-Schema
|
|
21
|
+
* renderer. A loose superset — only the fields the renderer reads are typed; the index signature
|
|
22
|
+
* carries everything else through untouched.
|
|
23
|
+
*/
|
|
24
|
+
export interface DescriptionLike {
|
|
25
|
+
/** Validator type name (e.g. `'string'`, `'object'`, `'array'`). */
|
|
26
|
+
type?: string;
|
|
27
|
+
/** Human-readable description of the field. */
|
|
28
|
+
description?: string;
|
|
29
|
+
/** Presence flag (`'optional'`, `'required'`, or `'forbidden'`) at the top level. */
|
|
30
|
+
presence?: string;
|
|
31
|
+
/** Default value supplied when the field is absent. */
|
|
32
|
+
default?: unknown;
|
|
33
|
+
/** Permitted values declared via an enum/valid set. */
|
|
34
|
+
enum?: unknown[];
|
|
35
|
+
/** Permitted values declared via the validator's `valid()` rule. */
|
|
36
|
+
valids?: unknown[];
|
|
37
|
+
/** Example values for the field. */
|
|
38
|
+
examples?: unknown[];
|
|
39
|
+
/** Nested property descriptions, keyed by property name (for object types). */
|
|
40
|
+
properties?: Record<string, DescriptionLike>;
|
|
41
|
+
/** Element description(s) for array types. */
|
|
42
|
+
items?: DescriptionLike | DescriptionLike[];
|
|
43
|
+
/** Names of required properties (for object types). */
|
|
44
|
+
required?: string[];
|
|
45
|
+
/** Validator flags bag carrying presence, description, and default. */
|
|
46
|
+
flags?: {
|
|
47
|
+
presence?: string;
|
|
48
|
+
description?: string;
|
|
49
|
+
default?: unknown;
|
|
50
|
+
};
|
|
51
|
+
/** Pass-through for any other validator metadata the renderer does not read. */
|
|
52
|
+
[key: string]: unknown;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* The subset of JSON Schema that Chat-family tool/function `parameters` accept, as emitted by
|
|
56
|
+
* {@link ChatHelpersCommon.descriptionToChatCompletionsJsonSchema}. The index signature allows
|
|
57
|
+
* extra keywords to pass through to the wire.
|
|
58
|
+
*/
|
|
59
|
+
export interface JsonSchema {
|
|
60
|
+
/** JSON Schema primitive/compound type. */
|
|
61
|
+
type?: 'string' | 'number' | 'integer' | 'boolean' | 'object' | 'array' | 'null';
|
|
62
|
+
/** Human-readable description of the schema node. */
|
|
63
|
+
description?: string;
|
|
64
|
+
/** Permitted values for the node. */
|
|
65
|
+
enum?: unknown[];
|
|
66
|
+
/** Default value for the node. */
|
|
67
|
+
default?: unknown;
|
|
68
|
+
/** Example values for the node. */
|
|
69
|
+
examples?: unknown[];
|
|
70
|
+
/** Property schemas keyed by property name (for `object` types). */
|
|
71
|
+
properties?: Record<string, JsonSchema>;
|
|
72
|
+
/** Names of required properties (for `object` types). */
|
|
73
|
+
required?: string[];
|
|
74
|
+
/** Element schema(s) for `array` types. */
|
|
75
|
+
items?: JsonSchema | JsonSchema[];
|
|
76
|
+
/** Whether (or what schema) additional, undeclared properties are permitted. */
|
|
77
|
+
additionalProperties?: boolean | JsonSchema;
|
|
78
|
+
/** Pass-through for any other JSON Schema keyword. */
|
|
79
|
+
[key: string]: unknown;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Attribute bag rendered onto the trust envelope that wraps untrusted (third-party) content.
|
|
83
|
+
*/
|
|
84
|
+
export interface UntrustedContentAttrs {
|
|
85
|
+
/** Per-render nonce binding the envelope's open and close markers together. */
|
|
86
|
+
nonce: string;
|
|
87
|
+
/** Content classifier rendered on the envelope. */
|
|
88
|
+
kind: string;
|
|
89
|
+
/** Name of the tool that produced the content, when applicable. */
|
|
90
|
+
tool?: string;
|
|
91
|
+
/**
|
|
92
|
+
* When wrapping a {@link @nhtio/adk!Media}-derived text marker, the modality hazard axis derived from
|
|
93
|
+
* `media.modalityHazard`: `'inert'`, `'extractable'` (from `'extractable-instructions'`), or
|
|
94
|
+
* `'opaque'` (from `'opaque-perceptual'`). Omitted for non-media envelopes.
|
|
95
|
+
*/
|
|
96
|
+
modality?: 'inert' | 'extractable' | 'opaque';
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Attribute bag rendered onto the trust envelope that wraps trusted (first-party) content.
|
|
100
|
+
*/
|
|
101
|
+
export interface TrustedContentAttrs {
|
|
102
|
+
/** Per-render nonce binding the envelope's open and close markers together. */
|
|
103
|
+
nonce: string;
|
|
104
|
+
/** Content classifier rendered on the envelope. */
|
|
105
|
+
kind: string;
|
|
106
|
+
/** Name of the tool that produced the content, when applicable. */
|
|
107
|
+
tool?: string;
|
|
108
|
+
/**
|
|
109
|
+
* Same semantics as {@link UntrustedContentAttrs.modality}.
|
|
110
|
+
*/
|
|
111
|
+
modality?: 'inert' | 'extractable' | 'opaque';
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Attribute bag rendered onto a standing-instruction block.
|
|
115
|
+
*/
|
|
116
|
+
export interface StandingInstructionAttrs {
|
|
117
|
+
/** Optional version label for the standing instruction. */
|
|
118
|
+
version?: string;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Attribute bag rendered onto a memory block.
|
|
122
|
+
*/
|
|
123
|
+
export interface MemoryAttrs {
|
|
124
|
+
/** Per-render nonce binding the block's open and close markers together. */
|
|
125
|
+
nonce: string;
|
|
126
|
+
/** Origin of the memory (e.g. the producing subsystem). */
|
|
127
|
+
source?: string;
|
|
128
|
+
/** ISO-8601 creation timestamp of the memory. */
|
|
129
|
+
createdAt?: string;
|
|
130
|
+
/** Memory classifier. */
|
|
131
|
+
kind?: string;
|
|
132
|
+
/** Relevance/recall score, when the memory was retrieved by similarity. */
|
|
133
|
+
score?: number;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Attribute bag rendered onto a retrievable block.
|
|
137
|
+
*/
|
|
138
|
+
export interface RetrievableAttrs {
|
|
139
|
+
/** Per-render nonce binding the block's open and close markers together. */
|
|
140
|
+
nonce: string;
|
|
141
|
+
/** Origin of the retrievable (e.g. the source document or system). */
|
|
142
|
+
source?: string;
|
|
143
|
+
/** ISO-8601 creation timestamp of the retrievable. */
|
|
144
|
+
createdAt?: string;
|
|
145
|
+
/** Retrievable classifier. */
|
|
146
|
+
kind?: string;
|
|
147
|
+
/** Relevance score from the retrieval query. */
|
|
148
|
+
score?: number;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Attribute bag rendered onto a thought block.
|
|
152
|
+
*/
|
|
153
|
+
export interface ThoughtAttrs {
|
|
154
|
+
/** Per-render nonce binding the block's open and close markers together. */
|
|
155
|
+
nonce: string;
|
|
156
|
+
/** Whether the thought is the model's own, a peer's, or opaque vendor reasoning. */
|
|
157
|
+
kind: 'self-reasoning' | 'peer-reasoning' | 'opaque-reasoning';
|
|
158
|
+
/** Identity of the agent the thought originated from. */
|
|
159
|
+
from: string;
|
|
160
|
+
/** ISO-8601 creation timestamp of the thought. */
|
|
161
|
+
createdAt?: string;
|
|
162
|
+
/** Replay-compatibility label gating whether the thought is surfaced on replay. */
|
|
163
|
+
replayCompatibility?: string;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Name of a system-prompt content bucket whose render order is configurable.
|
|
167
|
+
*/
|
|
168
|
+
export type ChatCompletionsBucketLabel = 'standingInstructions' | 'memories' | 'retrievables' | 'timeline';
|
|
169
|
+
/**
|
|
170
|
+
* Ordered list of {@link ChatCompletionsBucketLabel}s controlling the sequence in which content
|
|
171
|
+
* buckets are assembled into the prompt.
|
|
172
|
+
*/
|
|
173
|
+
export type ChatCompletionsBucketOrder = ReadonlyArray<ChatCompletionsBucketLabel>;
|
|
174
|
+
/**
|
|
175
|
+
* Wire shape of a single function tool advertised to the model — identical for OpenAI Chat
|
|
176
|
+
* Completions and Ollama.
|
|
177
|
+
*/
|
|
178
|
+
export interface ChatCompletionsTool {
|
|
179
|
+
/** Tool kind; always `'function'` for the bundled batteries. */
|
|
180
|
+
type: 'function';
|
|
181
|
+
/** The function declaration: its name, description, and JSON-Schema parameters. */
|
|
182
|
+
function: {
|
|
183
|
+
name: string;
|
|
184
|
+
description?: string;
|
|
185
|
+
parameters?: JsonSchema;
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Policy for how a Chat-family battery handles a {@link @nhtio/adk!Media} instance whose modality the
|
|
190
|
+
* wire protocol cannot natively represent.
|
|
191
|
+
*
|
|
192
|
+
* @remarks
|
|
193
|
+
* The option SHAPE is shared; each battery decides which modalities count as "unsupported"
|
|
194
|
+
* (OpenAI Chat Completions: video; Ollama native `/api/chat`: everything except image). Three
|
|
195
|
+
* modes:
|
|
196
|
+
*
|
|
197
|
+
* - `'throw'` — raise the battery's unsupported-media exception and fail the dispatch. Loud
|
|
198
|
+
* failure; the default, so a misconfigured pipeline surfaces immediately.
|
|
199
|
+
* - `'fallback-stash'` — look for a model-readable text entry in `media.stash`. If present, render
|
|
200
|
+
* that text inside the appropriate trust envelope in lieu of a media block. If no entry is found,
|
|
201
|
+
* fall through to `'synthetic-description'` behaviour. The shorthand string form uses the
|
|
202
|
+
* battery's default key list (`['text:transcript', 'text:caption', 'text:description']`, walked
|
|
203
|
+
* in order). The object form `{ mode: 'fallback-stash'; stashKeys }` overrides the key list.
|
|
204
|
+
* - `'synthetic-description'` — always render a synthetic text description constructed from
|
|
205
|
+
* `filename`, `byteLength`, and `mimeType` regardless of `stash` presence.
|
|
206
|
+
*/
|
|
207
|
+
export type UnsupportedMediaPolicy = 'throw' | 'fallback-stash' | 'synthetic-description' | {
|
|
208
|
+
mode: 'fallback-stash';
|
|
209
|
+
stashKeys: ReadonlyArray<string>;
|
|
210
|
+
};
|
|
211
|
+
/**
|
|
212
|
+
* Retry/backoff configuration for a Chat-family battery's HTTP requests.
|
|
213
|
+
*/
|
|
214
|
+
export interface ChatCompletionsRetryConfig {
|
|
215
|
+
/** Maximum number of attempts (including the first) before giving up. */
|
|
216
|
+
maxAttempts?: number;
|
|
217
|
+
/** Base delay in milliseconds for the first retry; doubles each attempt. */
|
|
218
|
+
baseDelayMs?: number;
|
|
219
|
+
/** Upper bound in milliseconds on any single backoff delay. */
|
|
220
|
+
maxDelayMs?: number;
|
|
221
|
+
/** HTTP status codes that trigger a retry. */
|
|
222
|
+
retriableStatuses?: number[];
|
|
223
|
+
/** Whether to honour a server `Retry-After` header in place of computed backoff. */
|
|
224
|
+
honorRetryAfter?: boolean;
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* The wire-shape-agnostic subset of a Chat-family battery's translation helpers — every helper
|
|
228
|
+
* that produces a plain `string` (or JSON Schema / tool-definition wire, which is identical across
|
|
229
|
+
* the family) rather than a battery-specific message object.
|
|
230
|
+
*
|
|
231
|
+
* @remarks
|
|
232
|
+
* Both `ChatCompletionsHelpers` (OpenAI battery) and `OllamaHelpers` (Ollama battery) extend this
|
|
233
|
+
* contract and add their own wire-specific members (timeline-message rendering, tool-call-result
|
|
234
|
+
* rendering, history assembly, and — for OpenAI — streaming tool-call delta accumulation). Helpers
|
|
235
|
+
* that compose other helpers receive their dependents via explicit `deps` arguments typed against
|
|
236
|
+
* THIS contract (never against a battery-specific bag), so the shared implementations carry no
|
|
237
|
+
* import edge back to any individual battery.
|
|
238
|
+
*/
|
|
239
|
+
export interface ChatHelpersCommon {
|
|
240
|
+
/** Converts a validator `describe()` envelope into the Chat-Completions JSON-Schema subset. */
|
|
241
|
+
descriptionToChatCompletionsJsonSchema: (d: DescriptionLike) => JsonSchema;
|
|
242
|
+
/** Wraps untrusted (third-party) text in the untrusted-content trust envelope. */
|
|
243
|
+
renderUntrustedContent: (content: string, attrs: UntrustedContentAttrs) => string;
|
|
244
|
+
/** Wraps trusted (first-party) text in the trusted-content trust envelope. */
|
|
245
|
+
renderTrustedContent: (content: string, attrs: TrustedContentAttrs) => string;
|
|
246
|
+
/** Renders standing instructions into a single prompt block. */
|
|
247
|
+
renderStandingInstructions: (items: Iterable<Tokenizable>, attrs?: StandingInstructionAttrs) => string;
|
|
248
|
+
/** Renders memories (each with its attribute bag) into a single prompt block. */
|
|
249
|
+
renderMemories: (items: Iterable<{
|
|
250
|
+
memory: Memory;
|
|
251
|
+
attrs: MemoryAttrs;
|
|
252
|
+
}>) => string;
|
|
253
|
+
/** Renders the safety directive that precedes any retrievable content. */
|
|
254
|
+
renderRetrievableSafetyDirective: () => string;
|
|
255
|
+
/** Renders first-party (trusted) retrievables into a single prompt block. */
|
|
256
|
+
renderFirstPartyRetrievables: (items: Iterable<{
|
|
257
|
+
retrievable: Retrievable;
|
|
258
|
+
attrs: RetrievableAttrs;
|
|
259
|
+
}>) => Promise<string>;
|
|
260
|
+
/** Renders third-party public retrievables, wrapping each in the untrusted-content envelope. */
|
|
261
|
+
renderThirdPartyPublicRetrievables: (items: Iterable<{
|
|
262
|
+
retrievable: Retrievable;
|
|
263
|
+
attrs: RetrievableAttrs;
|
|
264
|
+
}>, deps: {
|
|
265
|
+
renderUntrustedContent: ChatHelpersCommon['renderUntrustedContent'];
|
|
266
|
+
}) => Promise<string>;
|
|
267
|
+
/** Renders third-party private retrievables, wrapping each in the untrusted-content envelope. */
|
|
268
|
+
renderThirdPartyPrivateRetrievables: (items: Iterable<{
|
|
269
|
+
retrievable: Retrievable;
|
|
270
|
+
attrs: RetrievableAttrs;
|
|
271
|
+
}>, deps: {
|
|
272
|
+
renderUntrustedContent: ChatHelpersCommon['renderUntrustedContent'];
|
|
273
|
+
}) => Promise<string>;
|
|
274
|
+
/** Assembles the full retrievables block: safety directive plus the trust-tiered sub-renderers. */
|
|
275
|
+
renderRetrievables: (items: Iterable<{
|
|
276
|
+
retrievable: Retrievable;
|
|
277
|
+
attrs: RetrievableAttrs;
|
|
278
|
+
}>, deps: {
|
|
279
|
+
renderRetrievableSafetyDirective: ChatHelpersCommon['renderRetrievableSafetyDirective'];
|
|
280
|
+
renderFirstPartyRetrievables: ChatHelpersCommon['renderFirstPartyRetrievables'];
|
|
281
|
+
renderThirdPartyPublicRetrievables: ChatHelpersCommon['renderThirdPartyPublicRetrievables'];
|
|
282
|
+
renderThirdPartyPrivateRetrievables: ChatHelpersCommon['renderThirdPartyPrivateRetrievables'];
|
|
283
|
+
renderUntrustedContent: ChatHelpersCommon['renderUntrustedContent'];
|
|
284
|
+
}) => Promise<string>;
|
|
285
|
+
/** Renders a single thought into its prompt block, optionally carrying an opaque replay payload. */
|
|
286
|
+
renderThought: (content: string, attrs: ThoughtAttrs, payload?: unknown) => string;
|
|
287
|
+
/** Selects which thoughts to surface, by surfacing mode, self identity, and replay compatibility. */
|
|
288
|
+
filterThoughts: (thoughts: Iterable<Thought>, mode: 'all-self' | 'latest-self' | 'all', selfIdentity: string, replayCompatibility: ReadonlyArray<string>) => Thought[];
|
|
289
|
+
/** Translates the tool registry into the function-tool wire array advertised to the model. */
|
|
290
|
+
toolsToChatCompletionsTools: (tools: ReadonlyArray<Tool | ArtifactTool>, deps: {
|
|
291
|
+
descriptionToChatCompletionsJsonSchema: (d: DescriptionLike) => JsonSchema;
|
|
292
|
+
}) => ChatCompletionsTool[];
|
|
293
|
+
/** Assembles the system-prompt message from its constituent buckets in {@link ChatCompletionsBucketOrder}. */
|
|
294
|
+
renderChatCompletionsSystemPrompt: (input: {
|
|
295
|
+
systemPrompt: Tokenizable;
|
|
296
|
+
standingInstructions: Iterable<Tokenizable>;
|
|
297
|
+
memories: Iterable<Memory>;
|
|
298
|
+
retrievables: Iterable<Retrievable>;
|
|
299
|
+
bucketOrder: ChatCompletionsBucketOrder;
|
|
300
|
+
renderStandingInstructions: ChatHelpersCommon['renderStandingInstructions'];
|
|
301
|
+
renderMemories: ChatHelpersCommon['renderMemories'];
|
|
302
|
+
renderRetrievables: ChatHelpersCommon['renderRetrievables'];
|
|
303
|
+
renderRetrievableSafetyDirective: ChatHelpersCommon['renderRetrievableSafetyDirective'];
|
|
304
|
+
renderFirstPartyRetrievables: ChatHelpersCommon['renderFirstPartyRetrievables'];
|
|
305
|
+
renderThirdPartyPublicRetrievables: ChatHelpersCommon['renderThirdPartyPublicRetrievables'];
|
|
306
|
+
renderThirdPartyPrivateRetrievables: ChatHelpersCommon['renderThirdPartyPrivateRetrievables'];
|
|
307
|
+
renderUntrustedContent: ChatHelpersCommon['renderUntrustedContent'];
|
|
308
|
+
}) => Promise<string>;
|
|
309
|
+
}
|
package/batteries/llm/index.d.ts
CHANGED
|
@@ -9,3 +9,8 @@ export { webLLMChatCompletionsOptionsSchema } from "./webllm_chat_completions/in
|
|
|
9
9
|
export { validateOptions as validateWebLLMChatCompletionsOptions } from "./webllm_chat_completions/index";
|
|
10
10
|
export { E_INVALID_WEBLLM_CHAT_COMPLETIONS_OPTIONS, E_WEBLLM_CHAT_COMPLETIONS_CONTEXT_OVERFLOW, E_WEBLLM_CHAT_COMPLETIONS_STREAM_ERROR, E_WEBLLM_CHAT_COMPLETIONS_INVALID_TOOL_CALL_ARGS, } from "./webllm_chat_completions/index";
|
|
11
11
|
export type { WebLLMChatCompletionsAdapterOptions, WebLLMChatCompletionsRequestBody, WebLLMEngine, WebLLMInitProgressReport, } from "./webllm_chat_completions/index";
|
|
12
|
+
export { OllamaAdapter } from "./ollama/index";
|
|
13
|
+
export { ollamaOptionsSchema } from "./ollama/index";
|
|
14
|
+
export { validateOptions as validateOllamaOptions } from "./ollama/index";
|
|
15
|
+
export { E_INVALID_OLLAMA_OPTIONS, E_OLLAMA_CONTEXT_OVERFLOW, E_OLLAMA_HTTP_ERROR, E_OLLAMA_STREAM_ERROR, E_OLLAMA_STREAM_STALLED, E_OLLAMA_REQUEST_TIMEOUT, E_OLLAMA_INVALID_TOOL_CALL_ARGS, E_OLLAMA_UNSUPPORTED_MEDIA_MODALITY, } from "./ollama/index";
|
|
16
|
+
export type { OllamaThink, OllamaFormat, OllamaRuntimeOptions, OllamaToolCall, OllamaMessage, OllamaTool, OllamaChatRequestBody, OllamaChatStreamChunk, OllamaChatResponse, OllamaHelpers, OllamaAdapterOptions, } from "./ollama/index";
|