@nhtio/adk 1.20260607.2 → 1.20260609.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +185 -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/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 +1 -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/searxng/exceptions.d.ts +21 -0
- package/batteries/tools/searxng/index.d.ts +150 -0
- package/batteries/tools/searxng.cjs +5 -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.cjs +3 -0
- package/batteries/tools.mjs +2 -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 +46 -28
- package/batteries.mjs +10 -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.d.ts +1 -1
- 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.cjs +1 -1
- package/eslint.mjs +1 -1
- 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 +13 -13
- package/index.mjs +13 -13
- 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 +264 -224
- 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/searxng-Bkrwhwhw.js +269 -0
- package/searxng-Bkrwhwhw.js.map +1 -0
- package/searxng-CyA-nEu5.mjs +257 -0
- package/searxng-CyA-nEu5.mjs.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
|
@@ -11,82 +11,8 @@
|
|
|
11
11
|
import type { TokenEncoding } from "../../../common";
|
|
12
12
|
import type { SpooledArtifact, Media, SpoolStore } from "../../../common";
|
|
13
13
|
import type { Tokenizable, Memory, Message, Thought, ToolCall, Retrievable, Tool, ArtifactTool, ToolRegistry } from "../../../common";
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
description?: string;
|
|
17
|
-
presence?: string;
|
|
18
|
-
default?: unknown;
|
|
19
|
-
enum?: unknown[];
|
|
20
|
-
valids?: unknown[];
|
|
21
|
-
examples?: unknown[];
|
|
22
|
-
properties?: Record<string, DescriptionLike>;
|
|
23
|
-
items?: DescriptionLike | DescriptionLike[];
|
|
24
|
-
required?: string[];
|
|
25
|
-
flags?: {
|
|
26
|
-
presence?: string;
|
|
27
|
-
description?: string;
|
|
28
|
-
default?: unknown;
|
|
29
|
-
};
|
|
30
|
-
[key: string]: unknown;
|
|
31
|
-
}
|
|
32
|
-
export interface JsonSchema {
|
|
33
|
-
type?: 'string' | 'number' | 'integer' | 'boolean' | 'object' | 'array' | 'null';
|
|
34
|
-
description?: string;
|
|
35
|
-
enum?: unknown[];
|
|
36
|
-
default?: unknown;
|
|
37
|
-
examples?: unknown[];
|
|
38
|
-
properties?: Record<string, JsonSchema>;
|
|
39
|
-
required?: string[];
|
|
40
|
-
items?: JsonSchema | JsonSchema[];
|
|
41
|
-
additionalProperties?: boolean | JsonSchema;
|
|
42
|
-
[key: string]: unknown;
|
|
43
|
-
}
|
|
44
|
-
export interface UntrustedContentAttrs {
|
|
45
|
-
nonce: string;
|
|
46
|
-
kind: string;
|
|
47
|
-
tool?: string;
|
|
48
|
-
/**
|
|
49
|
-
* When wrapping a {@link @nhtio/adk!Media}-derived text marker, the modality hazard axis derived from
|
|
50
|
-
* `media.modalityHazard`: `'inert'`, `'extractable'` (from `'extractable-instructions'`), or
|
|
51
|
-
* `'opaque'` (from `'opaque-perceptual'`). Omitted for non-media envelopes.
|
|
52
|
-
*/
|
|
53
|
-
modality?: 'inert' | 'extractable' | 'opaque';
|
|
54
|
-
}
|
|
55
|
-
export interface TrustedContentAttrs {
|
|
56
|
-
nonce: string;
|
|
57
|
-
kind: string;
|
|
58
|
-
tool?: string;
|
|
59
|
-
/**
|
|
60
|
-
* Same semantics as {@link UntrustedContentAttrs.modality}.
|
|
61
|
-
*/
|
|
62
|
-
modality?: 'inert' | 'extractable' | 'opaque';
|
|
63
|
-
}
|
|
64
|
-
export interface StandingInstructionAttrs {
|
|
65
|
-
version?: string;
|
|
66
|
-
}
|
|
67
|
-
export interface MemoryAttrs {
|
|
68
|
-
nonce: string;
|
|
69
|
-
source?: string;
|
|
70
|
-
createdAt?: string;
|
|
71
|
-
kind?: string;
|
|
72
|
-
score?: number;
|
|
73
|
-
}
|
|
74
|
-
export interface RetrievableAttrs {
|
|
75
|
-
nonce: string;
|
|
76
|
-
source?: string;
|
|
77
|
-
createdAt?: string;
|
|
78
|
-
kind?: string;
|
|
79
|
-
score?: number;
|
|
80
|
-
}
|
|
81
|
-
export interface ThoughtAttrs {
|
|
82
|
-
nonce: string;
|
|
83
|
-
kind: 'self-reasoning' | 'peer-reasoning' | 'opaque-reasoning';
|
|
84
|
-
from: string;
|
|
85
|
-
createdAt?: string;
|
|
86
|
-
replayCompatibility?: string;
|
|
87
|
-
}
|
|
88
|
-
export type ChatCompletionsBucketLabel = 'standingInstructions' | 'memories' | 'retrievables' | 'timeline';
|
|
89
|
-
export type ChatCompletionsBucketOrder = ReadonlyArray<ChatCompletionsBucketLabel>;
|
|
14
|
+
import type { JsonSchema, ChatCompletionsBucketOrder, ChatCompletionsTool, UnsupportedMediaPolicy, ChatCompletionsRetryConfig, ChatHelpersCommon } from "../chat_common/types";
|
|
15
|
+
export type { DescriptionLike, JsonSchema, UntrustedContentAttrs, TrustedContentAttrs, StandingInstructionAttrs, MemoryAttrs, RetrievableAttrs, ThoughtAttrs, ChatCompletionsBucketLabel, ChatCompletionsBucketOrder, ChatCompletionsTool, UnsupportedMediaPolicy, ChatCompletionsRetryConfig, } from "../chat_common/types";
|
|
90
16
|
/**
|
|
91
17
|
* A wire field name that may carry model reasoning/thinking output on an OpenAI-compatible
|
|
92
18
|
* Chat Completions response.
|
|
@@ -108,12 +34,30 @@ export type ReasoningFieldPrecedence = ReadonlyArray<ReasoningField>;
|
|
|
108
34
|
* came from and its `content`. Returned by `extractReasoningFields`.
|
|
109
35
|
*/
|
|
110
36
|
export interface ReasoningExtract {
|
|
37
|
+
/**
|
|
38
|
+
* The reasoning field name.
|
|
39
|
+
*/
|
|
111
40
|
field: ReasoningField;
|
|
41
|
+
/**
|
|
42
|
+
* The content of the reasoning block.
|
|
43
|
+
*/
|
|
112
44
|
content: string;
|
|
113
45
|
}
|
|
46
|
+
/**
|
|
47
|
+
* Wire representation of a tool call in a chat completion response or request.
|
|
48
|
+
*/
|
|
114
49
|
export interface ChatCompletionsToolCallWire {
|
|
50
|
+
/**
|
|
51
|
+
* Unique identifier for the tool call.
|
|
52
|
+
*/
|
|
115
53
|
id: string;
|
|
54
|
+
/**
|
|
55
|
+
* Type of the tool call, typically 'function'.
|
|
56
|
+
*/
|
|
116
57
|
type?: 'function';
|
|
58
|
+
/**
|
|
59
|
+
* Function detail payload.
|
|
60
|
+
*/
|
|
117
61
|
function?: {
|
|
118
62
|
name?: string;
|
|
119
63
|
arguments?: string;
|
|
@@ -152,189 +96,269 @@ export type ChatCompletionsContentBlock = {
|
|
|
152
96
|
file_data?: string;
|
|
153
97
|
};
|
|
154
98
|
};
|
|
99
|
+
/**
|
|
100
|
+
* Chat completion message wire object.
|
|
101
|
+
*/
|
|
155
102
|
export interface ChatCompletionsMessage {
|
|
103
|
+
/**
|
|
104
|
+
* The role of the author of this message.
|
|
105
|
+
*/
|
|
156
106
|
role: 'system' | 'user' | 'assistant' | 'tool' | 'developer';
|
|
107
|
+
/**
|
|
108
|
+
* The contents of the message.
|
|
109
|
+
*/
|
|
157
110
|
content: string | ChatCompletionsContentBlock[] | null;
|
|
111
|
+
/**
|
|
112
|
+
* An optional name for the participant.
|
|
113
|
+
*/
|
|
158
114
|
name?: string;
|
|
115
|
+
/**
|
|
116
|
+
* Tool call identifier if responding to a tool call.
|
|
117
|
+
*/
|
|
159
118
|
tool_call_id?: string;
|
|
119
|
+
/**
|
|
120
|
+
* The tool calls generated by the model.
|
|
121
|
+
*/
|
|
160
122
|
tool_calls?: ChatCompletionsToolCallWire[];
|
|
161
123
|
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
name: string;
|
|
166
|
-
description?: string;
|
|
167
|
-
parameters?: JsonSchema;
|
|
168
|
-
};
|
|
169
|
-
}
|
|
124
|
+
/**
|
|
125
|
+
* Part of a tool call in a streaming response.
|
|
126
|
+
*/
|
|
170
127
|
export interface ChatCompletionsToolCallDelta {
|
|
128
|
+
/**
|
|
129
|
+
* The index of the tool call in the stream.
|
|
130
|
+
*/
|
|
171
131
|
index: number;
|
|
132
|
+
/**
|
|
133
|
+
* The identifier of the tool call.
|
|
134
|
+
*/
|
|
172
135
|
id?: string;
|
|
136
|
+
/**
|
|
137
|
+
* The tool type, typically 'function'.
|
|
138
|
+
*/
|
|
173
139
|
type?: 'function';
|
|
140
|
+
/**
|
|
141
|
+
* The partial function name or arguments.
|
|
142
|
+
*/
|
|
174
143
|
function?: {
|
|
175
144
|
name?: string;
|
|
176
145
|
arguments?: string;
|
|
177
146
|
};
|
|
178
147
|
}
|
|
148
|
+
/**
|
|
149
|
+
* An assembled tool call ready for execution.
|
|
150
|
+
*/
|
|
179
151
|
export interface AssembledToolCall {
|
|
152
|
+
/**
|
|
153
|
+
* Unique identifier for the tool call.
|
|
154
|
+
*/
|
|
180
155
|
id: string;
|
|
156
|
+
/**
|
|
157
|
+
* Type of tool call, typically 'function'.
|
|
158
|
+
*/
|
|
181
159
|
type: 'function';
|
|
160
|
+
/**
|
|
161
|
+
* Name of the function to call.
|
|
162
|
+
*/
|
|
182
163
|
name: string;
|
|
164
|
+
/**
|
|
165
|
+
* Stringified JSON arguments for the function.
|
|
166
|
+
*/
|
|
183
167
|
args: string;
|
|
184
168
|
}
|
|
169
|
+
/**
|
|
170
|
+
* Accumulator for stitching together streaming tool call deltas into fully-assembled tool calls.
|
|
171
|
+
*/
|
|
185
172
|
export interface ChatCompletionsToolCallDeltaAccumulator {
|
|
173
|
+
/**
|
|
174
|
+
* Feeds a tool call delta into the accumulator.
|
|
175
|
+
*/
|
|
186
176
|
feed(delta: ChatCompletionsToolCallDelta): void;
|
|
177
|
+
/**
|
|
178
|
+
* Drains and returns the completed assembled tool calls.
|
|
179
|
+
*/
|
|
187
180
|
drain(): AssembledToolCall[];
|
|
188
181
|
}
|
|
182
|
+
/**
|
|
183
|
+
* Stream delta payload for a chat completion choice chunk.
|
|
184
|
+
*/
|
|
189
185
|
export interface ChatCompletionsChunkDelta {
|
|
186
|
+
/**
|
|
187
|
+
* Optional role of the message author.
|
|
188
|
+
*/
|
|
190
189
|
role?: 'assistant';
|
|
190
|
+
/**
|
|
191
|
+
* The content block text fragment.
|
|
192
|
+
*/
|
|
191
193
|
content?: string | null;
|
|
194
|
+
/**
|
|
195
|
+
* De-facto field for model reasoning output.
|
|
196
|
+
*/
|
|
192
197
|
reasoning_content?: string | null;
|
|
193
198
|
/**
|
|
194
199
|
* Non-spec, provider-specific reasoning channel. Emitted by Ollama's `/v1` and current vLLM
|
|
195
200
|
* (which renamed `reasoning_content` → `reasoning`); see {@link OpenAIChatCompletionsAdapterOptions.reasoningFieldPrecedence}.
|
|
196
201
|
*/
|
|
197
202
|
reasoning?: string | null;
|
|
203
|
+
/**
|
|
204
|
+
* Partial stream deltas for tool calls.
|
|
205
|
+
*/
|
|
198
206
|
tool_calls?: ChatCompletionsToolCallDelta[];
|
|
199
207
|
}
|
|
208
|
+
/**
|
|
209
|
+
* A choice option in a streaming chat completions chunk.
|
|
210
|
+
*/
|
|
200
211
|
export interface ChatCompletionsChunkChoice {
|
|
212
|
+
/**
|
|
213
|
+
* Index of the choice in the completions list.
|
|
214
|
+
*/
|
|
201
215
|
index?: number;
|
|
216
|
+
/**
|
|
217
|
+
* The stream delta object.
|
|
218
|
+
*/
|
|
202
219
|
delta?: ChatCompletionsChunkDelta;
|
|
220
|
+
/**
|
|
221
|
+
* The reason the generation stopped.
|
|
222
|
+
*/
|
|
203
223
|
finish_reason?: string | null;
|
|
204
224
|
}
|
|
225
|
+
/**
|
|
226
|
+
* Streaming chunk response from a chat completion API.
|
|
227
|
+
*/
|
|
205
228
|
export interface ChatCompletionsChunk {
|
|
229
|
+
/**
|
|
230
|
+
* Unique identifier for the chunk.
|
|
231
|
+
*/
|
|
206
232
|
id?: string;
|
|
233
|
+
/**
|
|
234
|
+
* The object type, typically 'chat.completion.chunk'.
|
|
235
|
+
*/
|
|
207
236
|
object?: string;
|
|
237
|
+
/**
|
|
238
|
+
* Unix timestamp when the chunk was created.
|
|
239
|
+
*/
|
|
208
240
|
created?: number;
|
|
241
|
+
/**
|
|
242
|
+
* The model name used for generation.
|
|
243
|
+
*/
|
|
209
244
|
model?: string;
|
|
245
|
+
/**
|
|
246
|
+
* List of chunk choice options.
|
|
247
|
+
*/
|
|
210
248
|
choices?: ChatCompletionsChunkChoice[];
|
|
249
|
+
/**
|
|
250
|
+
* Token usage statistics if requested.
|
|
251
|
+
*/
|
|
211
252
|
usage?: Record<string, unknown>;
|
|
212
253
|
}
|
|
254
|
+
/**
|
|
255
|
+
* A message response in non-streaming chat completions.
|
|
256
|
+
*/
|
|
213
257
|
export interface ChatCompletionsResponseMessage {
|
|
258
|
+
/**
|
|
259
|
+
* Role of the message author.
|
|
260
|
+
*/
|
|
214
261
|
role?: 'assistant';
|
|
262
|
+
/**
|
|
263
|
+
* Text contents of the response.
|
|
264
|
+
*/
|
|
215
265
|
content?: string | null;
|
|
266
|
+
/**
|
|
267
|
+
* De-facto field for model reasoning output.
|
|
268
|
+
*/
|
|
216
269
|
reasoning_content?: string | null;
|
|
217
270
|
/**
|
|
218
271
|
* Non-spec, provider-specific reasoning channel. Emitted by Ollama's `/v1` and current vLLM
|
|
219
272
|
* (which renamed `reasoning_content` → `reasoning`); see {@link OpenAIChatCompletionsAdapterOptions.reasoningFieldPrecedence}.
|
|
220
273
|
*/
|
|
221
274
|
reasoning?: string | null;
|
|
275
|
+
/**
|
|
276
|
+
* The tool calls returned by the model.
|
|
277
|
+
*/
|
|
222
278
|
tool_calls?: ChatCompletionsToolCallWire[];
|
|
223
279
|
}
|
|
280
|
+
/**
|
|
281
|
+
* A choice returned in non-streaming chat completions.
|
|
282
|
+
*/
|
|
224
283
|
export interface ChatCompletionsResponseChoice {
|
|
284
|
+
/**
|
|
285
|
+
* Index of the choice in the list.
|
|
286
|
+
*/
|
|
225
287
|
index?: number;
|
|
288
|
+
/**
|
|
289
|
+
* Message response payload.
|
|
290
|
+
*/
|
|
226
291
|
message?: ChatCompletionsResponseMessage;
|
|
292
|
+
/**
|
|
293
|
+
* Reason why the model finished generating.
|
|
294
|
+
*/
|
|
227
295
|
finish_reason?: string | null;
|
|
228
296
|
}
|
|
297
|
+
/**
|
|
298
|
+
* Non-streaming chat completion response payload.
|
|
299
|
+
*/
|
|
229
300
|
export interface ChatCompletionsResponse {
|
|
301
|
+
/**
|
|
302
|
+
* Unique identifier for the response.
|
|
303
|
+
*/
|
|
230
304
|
id?: string;
|
|
305
|
+
/**
|
|
306
|
+
* Object type, typically 'chat.completion'.
|
|
307
|
+
*/
|
|
231
308
|
object?: string;
|
|
309
|
+
/**
|
|
310
|
+
* Unix timestamp when the response was created.
|
|
311
|
+
*/
|
|
232
312
|
created?: number;
|
|
313
|
+
/**
|
|
314
|
+
* Model used for completion.
|
|
315
|
+
*/
|
|
233
316
|
model?: string;
|
|
317
|
+
/**
|
|
318
|
+
* List of choices generated by the model.
|
|
319
|
+
*/
|
|
234
320
|
choices?: ChatCompletionsResponseChoice[];
|
|
321
|
+
/**
|
|
322
|
+
* Token usage statistics.
|
|
323
|
+
*/
|
|
235
324
|
usage?: Record<string, unknown>;
|
|
236
325
|
}
|
|
237
326
|
/**
|
|
238
|
-
*
|
|
239
|
-
* modality the wire protocol cannot natively represent (today: video).
|
|
327
|
+
* Full translation-helper contract for the OpenAI Chat Completions battery.
|
|
240
328
|
*
|
|
241
329
|
* @remarks
|
|
242
|
-
*
|
|
243
|
-
*
|
|
244
|
-
*
|
|
245
|
-
*
|
|
246
|
-
* -
|
|
247
|
-
*
|
|
248
|
-
* If no entry is found, fall through to `'synthetic-description'` behaviour. The shorthand
|
|
249
|
-
* string form uses the battery's default key list (`['text:transcript', 'text:caption',
|
|
250
|
-
* 'text:description']`, walked in order). The object form `{ mode: 'fallback-stash';
|
|
251
|
-
* stashKeys }` overrides the key list.
|
|
252
|
-
* - `'synthetic-description'` — always render a synthetic text description constructed from
|
|
253
|
-
* `filename`, `byteLength`, and `mimeType` (e.g. `[media: report.mp4, video/mp4, 38.4 MB]`)
|
|
254
|
-
* regardless of `stash` presence.
|
|
330
|
+
* Extends the wire-shape-agnostic {@link ChatHelpersCommon} (the string/JSON-Schema/tool-definition
|
|
331
|
+
* renderers shared with the Ollama battery) and adds the OpenAI-wire-specific members: timeline
|
|
332
|
+
* message rendering (content blocks), tool-call-result rendering (content blocks), full-history
|
|
333
|
+
* assembly (synthetic `assistant.tool_calls` + `tool.tool_call_id` shape), and the streaming
|
|
334
|
+
* tool-call delta accumulator. The `deps` parameters reference {@link ChatHelpersCommon} member
|
|
335
|
+
* types, so this interface carries no self-referential typing for the shared helpers.
|
|
255
336
|
*/
|
|
256
|
-
export
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
export interface ChatCompletionsRetryConfig {
|
|
261
|
-
maxAttempts?: number;
|
|
262
|
-
baseDelayMs?: number;
|
|
263
|
-
maxDelayMs?: number;
|
|
264
|
-
retriableStatuses?: number[];
|
|
265
|
-
honorRetryAfter?: boolean;
|
|
266
|
-
}
|
|
267
|
-
export interface ChatCompletionsHelpers {
|
|
268
|
-
descriptionToChatCompletionsJsonSchema: (d: DescriptionLike) => JsonSchema;
|
|
269
|
-
renderUntrustedContent: (content: string, attrs: UntrustedContentAttrs) => string;
|
|
270
|
-
renderTrustedContent: (content: string, attrs: TrustedContentAttrs) => string;
|
|
271
|
-
renderStandingInstructions: (items: Iterable<Tokenizable>, attrs?: StandingInstructionAttrs) => string;
|
|
272
|
-
renderMemories: (items: Iterable<{
|
|
273
|
-
memory: Memory;
|
|
274
|
-
attrs: MemoryAttrs;
|
|
275
|
-
}>) => string;
|
|
276
|
-
renderRetrievableSafetyDirective: () => string;
|
|
277
|
-
renderFirstPartyRetrievables: (items: Iterable<{
|
|
278
|
-
retrievable: Retrievable;
|
|
279
|
-
attrs: RetrievableAttrs;
|
|
280
|
-
}>) => Promise<string>;
|
|
281
|
-
renderThirdPartyPublicRetrievables: (items: Iterable<{
|
|
282
|
-
retrievable: Retrievable;
|
|
283
|
-
attrs: RetrievableAttrs;
|
|
284
|
-
}>, deps: {
|
|
285
|
-
renderUntrustedContent: ChatCompletionsHelpers['renderUntrustedContent'];
|
|
286
|
-
}) => Promise<string>;
|
|
287
|
-
renderThirdPartyPrivateRetrievables: (items: Iterable<{
|
|
288
|
-
retrievable: Retrievable;
|
|
289
|
-
attrs: RetrievableAttrs;
|
|
290
|
-
}>, deps: {
|
|
291
|
-
renderUntrustedContent: ChatCompletionsHelpers['renderUntrustedContent'];
|
|
292
|
-
}) => Promise<string>;
|
|
293
|
-
renderRetrievables: (items: Iterable<{
|
|
294
|
-
retrievable: Retrievable;
|
|
295
|
-
attrs: RetrievableAttrs;
|
|
296
|
-
}>, deps: {
|
|
297
|
-
renderRetrievableSafetyDirective: ChatCompletionsHelpers['renderRetrievableSafetyDirective'];
|
|
298
|
-
renderFirstPartyRetrievables: ChatCompletionsHelpers['renderFirstPartyRetrievables'];
|
|
299
|
-
renderThirdPartyPublicRetrievables: ChatCompletionsHelpers['renderThirdPartyPublicRetrievables'];
|
|
300
|
-
renderThirdPartyPrivateRetrievables: ChatCompletionsHelpers['renderThirdPartyPrivateRetrievables'];
|
|
301
|
-
renderUntrustedContent: ChatCompletionsHelpers['renderUntrustedContent'];
|
|
302
|
-
}) => Promise<string>;
|
|
337
|
+
export interface ChatCompletionsHelpers extends ChatHelpersCommon {
|
|
338
|
+
/**
|
|
339
|
+
* Renders a timeline message into a wire-formatted message.
|
|
340
|
+
*/
|
|
303
341
|
renderTimelineMessage: (input: {
|
|
304
342
|
message: Message;
|
|
305
343
|
selfIdentity: string;
|
|
306
344
|
unsupportedMediaPolicy: UnsupportedMediaPolicy;
|
|
307
345
|
warn?: (msg: string) => void;
|
|
308
346
|
}) => Promise<ChatCompletionsMessage>;
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
descriptionToChatCompletionsJsonSchema: (d: DescriptionLike) => JsonSchema;
|
|
313
|
-
}) => ChatCompletionsTool[];
|
|
314
|
-
renderChatCompletionsSystemPrompt: (input: {
|
|
315
|
-
systemPrompt: Tokenizable;
|
|
316
|
-
standingInstructions: Iterable<Tokenizable>;
|
|
317
|
-
memories: Iterable<Memory>;
|
|
318
|
-
retrievables: Iterable<Retrievable>;
|
|
319
|
-
bucketOrder: ChatCompletionsBucketOrder;
|
|
320
|
-
renderStandingInstructions: ChatCompletionsHelpers['renderStandingInstructions'];
|
|
321
|
-
renderMemories: ChatCompletionsHelpers['renderMemories'];
|
|
322
|
-
renderRetrievables: ChatCompletionsHelpers['renderRetrievables'];
|
|
323
|
-
renderRetrievableSafetyDirective: ChatCompletionsHelpers['renderRetrievableSafetyDirective'];
|
|
324
|
-
renderFirstPartyRetrievables: ChatCompletionsHelpers['renderFirstPartyRetrievables'];
|
|
325
|
-
renderThirdPartyPublicRetrievables: ChatCompletionsHelpers['renderThirdPartyPublicRetrievables'];
|
|
326
|
-
renderThirdPartyPrivateRetrievables: ChatCompletionsHelpers['renderThirdPartyPrivateRetrievables'];
|
|
327
|
-
renderUntrustedContent: ChatCompletionsHelpers['renderUntrustedContent'];
|
|
328
|
-
}) => Promise<string>;
|
|
347
|
+
/**
|
|
348
|
+
* Renders tool call result payloads into the corresponding wire-formatted message content blocks or text.
|
|
349
|
+
*/
|
|
329
350
|
renderChatCompletionsToolCallResult: (input: {
|
|
330
351
|
toolCall: ToolCall;
|
|
331
352
|
results: Tokenizable | SpooledArtifact | SpooledArtifact[] | Media | Media[];
|
|
332
353
|
tool: Tool | ArtifactTool | undefined;
|
|
333
|
-
renderUntrustedContent:
|
|
334
|
-
renderTrustedContent:
|
|
354
|
+
renderUntrustedContent: ChatHelpersCommon['renderUntrustedContent'];
|
|
355
|
+
renderTrustedContent: ChatHelpersCommon['renderTrustedContent'];
|
|
335
356
|
unsupportedMediaPolicy: UnsupportedMediaPolicy;
|
|
336
357
|
warn?: (msg: string) => void;
|
|
337
358
|
}) => Promise<string | ChatCompletionsContentBlock[]>;
|
|
359
|
+
/**
|
|
360
|
+
* Builds the entire chat history (system prompts, memories, retrievables, timeline, and thoughts) into wire format.
|
|
361
|
+
*/
|
|
338
362
|
buildChatCompletionsHistory: (input: {
|
|
339
363
|
systemPrompt: Tokenizable;
|
|
340
364
|
standingInstructions: Iterable<Tokenizable>;
|
|
@@ -351,19 +375,19 @@ export interface ChatCompletionsHelpers {
|
|
|
351
375
|
replayCompatibility: ReadonlyArray<string>;
|
|
352
376
|
unsupportedMediaPolicy: UnsupportedMediaPolicy;
|
|
353
377
|
renderChatCompletionsToolCallResult: ChatCompletionsHelpers['renderChatCompletionsToolCallResult'];
|
|
354
|
-
renderChatCompletionsSystemPrompt:
|
|
355
|
-
renderStandingInstructions:
|
|
356
|
-
renderMemories:
|
|
357
|
-
renderRetrievables:
|
|
358
|
-
renderRetrievableSafetyDirective:
|
|
359
|
-
renderFirstPartyRetrievables:
|
|
360
|
-
renderThirdPartyPublicRetrievables:
|
|
361
|
-
renderThirdPartyPrivateRetrievables:
|
|
378
|
+
renderChatCompletionsSystemPrompt: ChatHelpersCommon['renderChatCompletionsSystemPrompt'];
|
|
379
|
+
renderStandingInstructions: ChatHelpersCommon['renderStandingInstructions'];
|
|
380
|
+
renderMemories: ChatHelpersCommon['renderMemories'];
|
|
381
|
+
renderRetrievables: ChatHelpersCommon['renderRetrievables'];
|
|
382
|
+
renderRetrievableSafetyDirective: ChatHelpersCommon['renderRetrievableSafetyDirective'];
|
|
383
|
+
renderFirstPartyRetrievables: ChatHelpersCommon['renderFirstPartyRetrievables'];
|
|
384
|
+
renderThirdPartyPublicRetrievables: ChatHelpersCommon['renderThirdPartyPublicRetrievables'];
|
|
385
|
+
renderThirdPartyPrivateRetrievables: ChatHelpersCommon['renderThirdPartyPrivateRetrievables'];
|
|
362
386
|
renderTimelineMessage: ChatCompletionsHelpers['renderTimelineMessage'];
|
|
363
|
-
renderThought:
|
|
364
|
-
filterThoughts:
|
|
365
|
-
renderUntrustedContent:
|
|
366
|
-
renderTrustedContent:
|
|
387
|
+
renderThought: ChatHelpersCommon['renderThought'];
|
|
388
|
+
filterThoughts: ChatHelpersCommon['filterThoughts'];
|
|
389
|
+
renderUntrustedContent: ChatHelpersCommon['renderUntrustedContent'];
|
|
390
|
+
renderTrustedContent: ChatHelpersCommon['renderTrustedContent'];
|
|
367
391
|
warn?: (msg: string) => void;
|
|
368
392
|
}) => Promise<{
|
|
369
393
|
messages: ChatCompletionsMessage[];
|
|
@@ -373,12 +397,30 @@ export interface ChatCompletionsHelpers {
|
|
|
373
397
|
payload: unknown;
|
|
374
398
|
}>;
|
|
375
399
|
}>;
|
|
400
|
+
/**
|
|
401
|
+
* Instantiates a new tool call delta accumulator for streaming responses.
|
|
402
|
+
*/
|
|
376
403
|
createChatCompletionsToolCallDeltaAccumulator: () => ChatCompletionsToolCallDeltaAccumulator;
|
|
377
404
|
}
|
|
405
|
+
/**
|
|
406
|
+
* Request body structure for the OpenAI Chat Completions API.
|
|
407
|
+
*/
|
|
378
408
|
export interface OpenAIChatCompletionsRequestBody {
|
|
409
|
+
/**
|
|
410
|
+
* ID of the model to use.
|
|
411
|
+
*/
|
|
379
412
|
model: string;
|
|
413
|
+
/**
|
|
414
|
+
* A list of messages comprising the conversation history so far.
|
|
415
|
+
*/
|
|
380
416
|
messages: ChatCompletionsMessage[];
|
|
417
|
+
/**
|
|
418
|
+
* If set, partial message deltas will be sent as server-sent events.
|
|
419
|
+
*/
|
|
381
420
|
stream: boolean;
|
|
421
|
+
/**
|
|
422
|
+
* A list of tools the model may call.
|
|
423
|
+
*/
|
|
382
424
|
tools?: ChatCompletionsTool[];
|
|
383
425
|
/**
|
|
384
426
|
* Side-channel for opaque vendor reasoning payloads. Forwarded to gateways that understand
|
|
@@ -391,20 +433,37 @@ export interface OpenAIChatCompletionsRequestBody {
|
|
|
391
433
|
}>;
|
|
392
434
|
[key: string]: unknown;
|
|
393
435
|
}
|
|
436
|
+
/**
|
|
437
|
+
* Configuration options for the OpenAI Chat Completions adapter.
|
|
438
|
+
*/
|
|
394
439
|
export interface OpenAIChatCompletionsAdapterOptions {
|
|
440
|
+
/** API key for authenticating requests to the OpenAI-compatible service. */
|
|
395
441
|
apiKey?: string;
|
|
442
|
+
/** Base URL for the OpenAI-compatible API endpoint. */
|
|
396
443
|
baseURL?: string;
|
|
444
|
+
/** Extra HTTP headers to include with each request. */
|
|
397
445
|
headers?: Record<string, string>;
|
|
446
|
+
/** Whether to stream the completion response chunk by chunk. */
|
|
398
447
|
stream?: boolean;
|
|
448
|
+
/** Idle timeout in milliseconds for the stream before aborting. */
|
|
399
449
|
streamIdleTimeoutMs?: number;
|
|
450
|
+
/** Request timeout in milliseconds for API calls. */
|
|
400
451
|
requestTimeoutMs?: number;
|
|
452
|
+
/** Configures request retry behavior. */
|
|
401
453
|
retry?: ChatCompletionsRetryConfig;
|
|
454
|
+
/** Custom fetch implementation to use for HTTP requests. */
|
|
402
455
|
fetch?: typeof globalThis.fetch;
|
|
456
|
+
/** Determines order of memory and retrievable buckets in history assembly. */
|
|
403
457
|
bucketOrder?: ChatCompletionsBucketOrder;
|
|
458
|
+
/** Size of the model's token context window. */
|
|
404
459
|
contextWindow?: number;
|
|
460
|
+
/** Unique identity label for the assistant instance. */
|
|
405
461
|
selfIdentity?: string;
|
|
462
|
+
/** Determines which thoughts are surfaced back to the model. */
|
|
406
463
|
thoughtSurfacing?: 'all-self' | 'latest-self' | 'all';
|
|
464
|
+
/** Tokenizer encoding configuration for token counting. */
|
|
407
465
|
tokenEncoding?: TokenEncoding | null;
|
|
466
|
+
/** List of replay labels supported by the assistant. */
|
|
408
467
|
replayCompatibility?: ReadonlyArray<string>;
|
|
409
468
|
/**
|
|
410
469
|
* Ordered precedence of the wire fields the adapter reads for model reasoning/thinking output.
|
|
@@ -424,6 +483,7 @@ export interface OpenAIChatCompletionsAdapterOptions {
|
|
|
424
483
|
* @defaultValue `['reasoning', 'reasoning_content']`
|
|
425
484
|
*/
|
|
426
485
|
reasoningFieldPrecedence?: ReasoningFieldPrecedence;
|
|
486
|
+
/** Optional overrides for OpenAI chat completions helpers. */
|
|
427
487
|
helpers?: Partial<ChatCompletionsHelpers>;
|
|
428
488
|
/**
|
|
429
489
|
* Backing store for `string` / `Uint8Array` tool returns. Tool output bytes are written under the
|
|
@@ -494,28 +554,42 @@ export interface OpenAIChatCompletionsAdapterOptions {
|
|
|
494
554
|
* @defaultValue `false`
|
|
495
555
|
*/
|
|
496
556
|
autoAck?: boolean;
|
|
557
|
+
/** Name of the model to use for completion. */
|
|
497
558
|
model: string;
|
|
559
|
+
/** Parameters for audio output if requested. */
|
|
498
560
|
audio?: {
|
|
499
561
|
voice: string;
|
|
500
562
|
format: 'wav' | 'mp3' | 'flac' | 'opus' | 'pcm16';
|
|
501
563
|
};
|
|
564
|
+
/** Frequency penalty wire field to discourage repeating words. */
|
|
502
565
|
frequency_penalty?: number;
|
|
566
|
+
/** Deprecated wire field to control which function is called. */
|
|
503
567
|
function_call?: 'none' | 'auto' | {
|
|
504
568
|
name: string;
|
|
505
569
|
};
|
|
570
|
+
/** Deprecated list of functions available to the model. */
|
|
506
571
|
functions?: Array<{
|
|
507
572
|
name: string;
|
|
508
573
|
description?: string;
|
|
509
574
|
parameters?: JsonSchema;
|
|
510
575
|
}>;
|
|
576
|
+
/** Bias logits to control token generation likelihood. */
|
|
511
577
|
logit_bias?: Record<string, number>;
|
|
578
|
+
/** Request log probabilities for generated tokens. */
|
|
512
579
|
logprobs?: boolean;
|
|
580
|
+
/** Hard limit on token count for model reasoning/completion. */
|
|
513
581
|
max_completion_tokens?: number;
|
|
582
|
+
/** Maximum number of generated tokens. */
|
|
514
583
|
max_tokens?: number;
|
|
584
|
+
/** Metadata key-value pairs forwarded to the provider. */
|
|
515
585
|
metadata?: Record<string, string>;
|
|
586
|
+
/** Desired modalities for model output, such as text and audio. */
|
|
516
587
|
modalities?: Array<'text' | 'audio'>;
|
|
588
|
+
/** Number of completions to generate for each request. */
|
|
517
589
|
n?: number;
|
|
590
|
+
/** Allow the model to emit multiple tool calls in one turn. */
|
|
518
591
|
parallel_tool_calls?: boolean;
|
|
592
|
+
/** Prediction helper to accelerate latency of known content. */
|
|
519
593
|
prediction?: {
|
|
520
594
|
type: 'content';
|
|
521
595
|
content: string | Array<{
|
|
@@ -523,10 +597,15 @@ export interface OpenAIChatCompletionsAdapterOptions {
|
|
|
523
597
|
text: string;
|
|
524
598
|
}>;
|
|
525
599
|
};
|
|
600
|
+
/** Presence penalty wire field to encourage new topics. */
|
|
526
601
|
presence_penalty?: number;
|
|
602
|
+
/** Vendor cache key for caching system prompts. */
|
|
527
603
|
prompt_cache_key?: string;
|
|
604
|
+
/** Cache retention strategy for cached system prompts. */
|
|
528
605
|
prompt_cache_retention?: 'in_memory' | '24h';
|
|
529
|
-
|
|
606
|
+
/** Target reasoning depth/effort for reasoning models. */
|
|
607
|
+
reasoning_effort?: 'none' | 'minimal' | 'low' | 'medium' | 'high';
|
|
608
|
+
/** Enforces a specific output format, e.g. JSON schema. */
|
|
530
609
|
response_format?: {
|
|
531
610
|
type: 'text';
|
|
532
611
|
} | {
|
|
@@ -540,16 +619,24 @@ export interface OpenAIChatCompletionsAdapterOptions {
|
|
|
540
619
|
description?: string;
|
|
541
620
|
};
|
|
542
621
|
};
|
|
622
|
+
/** Unique safety system identifier or configuration ID. */
|
|
543
623
|
safety_identifier?: string;
|
|
624
|
+
/** Deterministic random seed for generation. */
|
|
544
625
|
seed?: number;
|
|
626
|
+
/** Service reliability tier for processing the request. */
|
|
545
627
|
service_tier?: 'auto' | 'default' | 'flex' | 'priority' | 'scale';
|
|
628
|
+
/** Custom stop sequence strings. */
|
|
546
629
|
stop?: string | string[];
|
|
630
|
+
/** Request the provider to store the completed trace. */
|
|
547
631
|
store?: boolean;
|
|
632
|
+
/** Configuration options for response streaming. */
|
|
548
633
|
stream_options?: {
|
|
549
634
|
include_usage?: boolean;
|
|
550
635
|
include_obfuscation?: boolean;
|
|
551
636
|
};
|
|
637
|
+
/** Sampling temperature control. */
|
|
552
638
|
temperature?: number;
|
|
639
|
+
/** Enforce or disable tool execution selection. */
|
|
553
640
|
tool_choice?: 'none' | 'auto' | 'required' | {
|
|
554
641
|
type: 'function';
|
|
555
642
|
function: {
|
|
@@ -577,10 +664,15 @@ export interface OpenAIChatCompletionsAdapterOptions {
|
|
|
577
664
|
}>;
|
|
578
665
|
};
|
|
579
666
|
};
|
|
667
|
+
/** Top log probability tokens limit. */
|
|
580
668
|
top_logprobs?: number;
|
|
669
|
+
/** Nucleus sampling probability threshold. */
|
|
581
670
|
top_p?: number;
|
|
671
|
+
/** End-user identifier for abuse monitoring. */
|
|
582
672
|
user?: string;
|
|
673
|
+
/** Diagnostics verbosity level. */
|
|
583
674
|
verbosity?: 'low' | 'medium' | 'high';
|
|
675
|
+
/** Configuration for built-in web search. */
|
|
584
676
|
web_search_options?: {
|
|
585
677
|
search_context_size?: 'low' | 'medium' | 'high';
|
|
586
678
|
user_location?: {
|