3.1 KiB
description, kind
| description | kind |
|---|---|
| Define test tools and invoke tool pipelines or selected executors in repository tests and benchmarks. | package-library |
@deepseek-ai/dsh-tool-testkit
English | 中文
Summary
Use this package to define content-producing test tools and exercise tool execution without running an Agent turn. Tests and benchmarks import its helpers as a development dependency. Callers own the Cordis context, plugin composition, and teardown.
Table of Contents
- Use this package
- Understand the implementation
- Further Exploration
- Model Experience
- Known Limitations and Deferred Work
- Dev Note
Use this package
Add @deepseek-ai/dsh-tool-testkit to the consuming package's devDependencies. Define a fixture when the test needs rendered content without a domain-specific result value:
import { defineContentToolFixture } from '@deepseek-ai/dsh-tool-testkit'
const tool = defineContentToolFixture({
name: 'echo',
description: 'Return a test message.',
parameters: {},
execute: async () => [{ type: 'text', text: 'hello' }],
})
Register the returned definition through the caller's tool registry. Use executeToolFixture for an already-parsed invocation, or executeModelToolFixture to pass one JSON-encoded call through the selected executor. The latter requires the caller to mount that executor and rejects arguments that cannot be JSON-encoded or an executor response without a result. See src/index.ts for invocation fields.
Understand the implementation
Implementation internals — click to expand
src/index.ts adapts content blocks into a tool's canonical JSON value and delegates execution to the production pipeline or registry. It creates no context and owns no plugin registrations.
Further Exploration
- Tools package — tool definitions, registry, and execution policy.
- Testing policy — choosing verification for production behavior.
- Test-support group map — sibling test utilities.
Model Experience
None, as these test helpers do not assemble or send model requests.
KV Cache effect
None; the package itself sends no provider request.
Known Limitations and Deferred Work
- Content-array values are test fixtures; product tools declare domain-owned output schemas.
- Direct pipeline execution omits model-batch scheduling. Both execution helpers omit root Session logging; use an Agent turn when verifying the recorded conversation.
- Plugin composition and context disposal remain caller-owned.
Dev Note
Working context for maintainers — click to expand
None.