{"_id":"@anygpt/mock","_rev":"7-339058ae3c841b1f48e81daa440f948f","name":"@anygpt/mock","dist-tags":{"latest":"2.0.1"},"versions":{"0.2.2":{"name":"@anygpt/mock","version":"0.2.2","keywords":["mock","testing","connector","ai","gpt"],"author":{"name":"AnyGPT Contributors"},"license":"MIT","_id":"@anygpt/mock@0.2.2","maintainers":[{"name":"theplenkov-npm","email":"petr.plenkov@gmail.com"}],"homepage":"https://github.com/genai-tools/anygpt#readme","bugs":{"url":"https://github.com/genai-tools/anygpt/issues"},"dist":{"shasum":"fb293d0fed03afbe5e0b072470502b379e57c34f","tarball":"https://registry.npmjs.org/@anygpt/mock/-/mock-0.2.2.tgz","fileCount":6,"integrity":"sha512-FjifFu1B01oRPiKeoJtxWpOYVDAJPhlXHdxlDkkcaKrFb7pR44buFl57tDQ9Du+9shkjJ0n80VS8WeEOT3zpoQ==","signatures":[{"sig":"MEQCIF6W9vdYkWvd5EhN6lISUy7DNWq3IgU42TuCl09r0tE+AiAOouKAR/IWVqoH2NemyRSer06Uw7UlcNZ1zXZdVbQcgg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@anygpt%2fmock@0.2.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":39648},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"7afca831e7f4bc95133539e174c81f7003db1f8a","_npmUser":{"name":"theplenkov-npm","email":"petr.plenkov@gmail.com"},"repository":{"url":"git+https://github.com/genai-tools/anygpt.git","type":"git","directory":"packages/connectors/mock"},"_npmVersion":"10.9.3","description":"Mock connector for AnyGPT - testing and development without real API calls","directories":{},"_nodeVersion":"22.20.0","dependencies":{"@anygpt/types":"0.1.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/mock_0.2.2_1759619530496_0.9648998633536237","host":"s3://npm-registry-packages-npm-production"}},"0.2.3":{"name":"@anygpt/mock","version":"0.2.3","keywords":["mock","testing","connector","ai","gpt"],"author":{"name":"AnyGPT Contributors"},"license":"MIT","_id":"@anygpt/mock@0.2.3","maintainers":[{"name":"theplenkov-npm","email":"petr.plenkov@gmail.com"}],"homepage":"https://github.com/genai-tools/anygpt#readme","bugs":{"url":"https://github.com/genai-tools/anygpt/issues"},"dist":{"shasum":"09b561d4ace84febe01547f0d96929445ca68cdf","tarball":"https://registry.npmjs.org/@anygpt/mock/-/mock-0.2.3.tgz","fileCount":6,"integrity":"sha512-7EkQ/5HRcIQDFdgojIXQgWchUk750HzfT75qVWFY0R/7MrjgBCn9b33h6CDtV0+rMJ2yMgYd0PPoSvDQi5vhLA==","signatures":[{"sig":"MEUCIQDMlRR2+NAJqrpKxI188djYdCXPksziaO4Ez7+/O67uCAIgJJZ4j623kexehk8TkUiX28EeYsgi8HUrkqXXboYSKQg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":39648},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"d7cf5764e5689d60076447b0f9234b0649c989be","_npmUser":{"name":"theplenkov-npm","email":"petr.plenkov@gmail.com"},"repository":{"url":"git+https://github.com/genai-tools/anygpt.git","type":"git","directory":"packages/connectors/mock"},"_npmVersion":"11.6.0","description":"Mock connector for AnyGPT - testing and development without real API calls","directories":{},"_nodeVersion":"24.9.0","dependencies":{"@anygpt/types":"0.1.4"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/mock_0.2.3_1759754276977_0.15976540371295944","host":"s3://npm-registry-packages-npm-production"}},"0.2.4":{"name":"@anygpt/mock","version":"0.2.4","keywords":["mock","testing","connector","ai","gpt"],"author":{"name":"AnyGPT Contributors"},"license":"MIT","_id":"@anygpt/mock@0.2.4","maintainers":[{"name":"theplenkov-npm","email":"petr.plenkov@gmail.com"}],"homepage":"https://github.com/genai-tools/anygpt#readme","bugs":{"url":"https://github.com/genai-tools/anygpt/issues"},"dist":{"shasum":"1955fe5e2e83f990a203155355ae3b6e2b43428a","tarball":"https://registry.npmjs.org/@anygpt/mock/-/mock-0.2.4.tgz","fileCount":6,"integrity":"sha512-MBi/kE1m+T4A/0yOv2n+cEpqfHlCxrEb0RCiCWycFD+7eBp8HHb1B6JfVP4khWEqWCueogx4JG3qKqza/TmjKA==","signatures":[{"sig":"MEQCIANCNT4fEzXS1bEjPwyWL11e4hxChYmcBsq82N1wk5F6AiBIgt63O12Pw5z3edsXw6Qh9DQvg68HG2Gpxaz6oLCCzg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":39648},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"459adc4bfe025048b6651c480c93334d18691233","_npmUser":{"name":"theplenkov-npm","email":"petr.plenkov@gmail.com"},"repository":{"url":"git+https://github.com/genai-tools/anygpt.git","type":"git","directory":"packages/connectors/mock"},"_npmVersion":"11.6.0","description":"Mock connector for AnyGPT - testing and development without real API calls","directories":{},"_nodeVersion":"24.9.0","dependencies":{"@anygpt/types":"0.2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/mock_0.2.4_1759909934336_0.8384560696805832","host":"s3://npm-registry-packages-npm-production"}},"1.0.0":{"name":"@anygpt/mock","version":"1.0.0","keywords":["mock","testing","connector","ai","gpt"],"author":{"name":"AnyGPT Contributors"},"license":"MIT","_id":"@anygpt/mock@1.0.0","maintainers":[{"name":"theplenkov-npm","email":"petr.plenkov@gmail.com"}],"homepage":"https://github.com/genai-tools/anygpt#readme","bugs":{"url":"https://github.com/genai-tools/anygpt/issues"},"dist":{"shasum":"57e2423ca7ebf5f8412b6d3c620db77f455aaad6","tarball":"https://registry.npmjs.org/@anygpt/mock/-/mock-1.0.0.tgz","fileCount":6,"integrity":"sha512-yHrYDYJ+FS6sQiyBITkdKNJsBJkONjSqOw5cx/Iz0s1dgqGVh7v7St5Jvqr+bk/UVUYrz/16CPP1IeaHYuhSkA==","signatures":[{"sig":"MEQCIFGJmHxjsZCdFOAuZFpik655oAfdQjFmL7/nzY9pgRkuAiBMEwhW/V78ImNlBuDRsJgeCznVJz7qsDJMIoHYCZ8Caw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":39648},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"23f2c0034f0e09fcced1adcc0a354a4bf03bb9ba","_npmUser":{"name":"theplenkov-npm","email":"petr.plenkov@gmail.com"},"repository":{"url":"git+https://github.com/genai-tools/anygpt.git","type":"git","directory":"packages/connectors/mock"},"_npmVersion":"11.6.0","description":"Mock connector for AnyGPT - testing and development without real API calls","directories":{},"_nodeVersion":"24.9.0","dependencies":{"@anygpt/types":"1.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/mock_1.0.0_1760004026508_0.5780347656435068","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@anygpt/mock","version":"1.0.1","keywords":["mock","testing","connector","ai","gpt"],"author":{"name":"AnyGPT Contributors"},"license":"MIT","_id":"@anygpt/mock@1.0.1","maintainers":[{"name":"theplenkov-npm","email":"petr.plenkov@gmail.com"}],"homepage":"https://github.com/genai-tools/anygpt#readme","bugs":{"url":"https://github.com/genai-tools/anygpt/issues"},"dist":{"shasum":"7c94507a345a07238925b58e6e284c12872f4b4e","tarball":"https://registry.npmjs.org/@anygpt/mock/-/mock-1.0.1.tgz","fileCount":6,"integrity":"sha512-yD0x3B1hEqER/ReiuREYZWAfQ8xQs2DozhOb+Gp1UWV/VQDybccbDxX57BOWUCbrXEdF1Qc4pFshnJUXBVJfuA==","signatures":[{"sig":"MEYCIQCenZcuEBwpDRO6J/pbnLv7Lj+3kHrk9vjJmMU1zfyWsAIhAOCGplIrbDYNIjvbZSOXaMYkFSONI9HiGK+dX/wQb4zj","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":39648},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"a6449019274244c118f478b3c2e182e9a3503d02","_npmUser":{"name":"theplenkov-npm","email":"petr.plenkov@gmail.com"},"repository":{"url":"git+https://github.com/genai-tools/anygpt.git","type":"git","directory":"packages/connectors/mock"},"_npmVersion":"11.6.0","description":"Mock connector for AnyGPT - testing and development without real API calls","directories":{},"_nodeVersion":"24.9.0","dependencies":{"@anygpt/types":"1.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/mock_1.0.1_1760222993130_0.0005603371200766372","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@anygpt/mock","version":"1.0.2","keywords":["mock","testing","connector","ai","gpt"],"author":{"name":"AnyGPT Contributors"},"license":"MIT","_id":"@anygpt/mock@1.0.2","maintainers":[{"name":"theplenkov-npm","email":"petr.plenkov@gmail.com"}],"homepage":"https://github.com/genai-tools/anygpt#readme","bugs":{"url":"https://github.com/genai-tools/anygpt/issues"},"dist":{"shasum":"7831c9971acc27c8e7cd84d1704da6edef3c5e16","tarball":"https://registry.npmjs.org/@anygpt/mock/-/mock-1.0.2.tgz","fileCount":6,"integrity":"sha512-rP1LyQ4R8mXzhqrj5YGhZGsreWI6OTYJPn2dKAxawcKwRM4qWcX/mVW3bM1XB5bnKOYiiNwSozt5JYFkIvprrQ==","signatures":[{"sig":"MEQCIFuGGuWtfZmN40mZ/5UkoZJh/rvwWqXvlpnfhM/li613AiAiJRMkM7Dr8IGZisXx/k69z5pK2n7f4cUvMeJuicNV9g==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":39648},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"6cd81e0e51813dca22fe3fd30f707d7b42a52e15","_npmUser":{"name":"theplenkov-npm","email":"petr.plenkov@gmail.com"},"repository":{"url":"git+https://github.com/genai-tools/anygpt.git","type":"git","directory":"packages/connectors/mock"},"_npmVersion":"11.6.1","description":"Mock connector for AnyGPT - testing and development without real API calls","directories":{},"_nodeVersion":"24.10.0","dependencies":{"@anygpt/types":"1.2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/mock_1.0.2_1760436823506_0.5058964658671439","host":"s3://npm-registry-packages-npm-production"}},"2.0.1":{"name":"@anygpt/mock","version":"2.0.1","description":"Mock connector for AnyGPT - testing and development without real API calls","type":"module","main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{"./package.json":"./package.json",".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"repository":{"type":"git","url":"git+https://github.com/genai-tools/anygpt.git","directory":"packages/connectors/mock"},"keywords":["mock","testing","connector","ai","gpt"],"author":{"name":"AnyGPT Contributors"},"license":"MIT","bugs":{"url":"https://github.com/genai-tools/anygpt/issues"},"homepage":"https://github.com/genai-tools/anygpt#readme","publishConfig":{"access":"public"},"dependencies":{"@anygpt/types":"2.0.1"},"gitHead":"694856d0f9aa5bafc05fbf934367a8add2fddb59","_id":"@anygpt/mock@2.0.1","_nodeVersion":"24.10.0","_npmVersion":"11.6.1","dist":{"integrity":"sha512-hzt511Q7L8datStlPvCx8u/kcpr3Q+3RAcDP5bRFrkeZu9z4BvlFFkSD9TJeLa3eF8c/rp4bPa0baQ1QSA7i7w==","shasum":"6a6ad406230fbfdc1ba8bfa217d23276912a1a73","tarball":"https://registry.npmjs.org/@anygpt/mock/-/mock-2.0.1.tgz","fileCount":6,"unpackedSize":39250,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCYjJogF7REk+h8PN/nel4QB4EiChZg+akOgFryfmI8qAIhAPWKveq/cfJohNvfeW2hl7qCk1vqZ808StWtPRdK2Fht"}]},"_npmUser":{"name":"theplenkov-npm","email":"petr.plenkov@gmail.com"},"directories":{},"maintainers":[{"name":"theplenkov-npm","email":"petr.plenkov@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mock_2.0.1_1761046510693_0.571179166852749"},"_hasShrinkwrap":false}},"time":{"created":"2025-10-04T23:12:10.440Z","modified":"2025-10-21T11:35:11.087Z","0.2.2":"2025-10-04T23:12:10.681Z","0.2.3":"2025-10-06T12:37:57.132Z","0.2.4":"2025-10-08T07:52:14.522Z","1.0.0":"2025-10-09T10:00:26.734Z","1.0.1":"2025-10-11T22:49:53.315Z","1.0.2":"2025-10-14T10:13:43.681Z","2.0.1":"2025-10-21T11:35:10.908Z"},"bugs":{"url":"https://github.com/genai-tools/anygpt/issues"},"author":{"name":"AnyGPT Contributors"},"license":"MIT","homepage":"https://github.com/genai-tools/anygpt#readme","keywords":["mock","testing","connector","ai","gpt"],"repository":{"type":"git","url":"git+https://github.com/genai-tools/anygpt.git","directory":"packages/connectors/mock"},"description":"Mock connector for AnyGPT - testing and development without real API calls","maintainers":[{"name":"theplenkov-npm","email":"petr.plenkov@gmail.com"}],"readme":"# @anygpt/mock\n\nMock connector for testing and development with the AnyGPT router system.\n\n## Features\n\n- **Realistic Mock Responses**: Generates contextual responses based on input\n- **Configurable Delays**: Simulate API latency for testing\n- **Failure Simulation**: Test error handling with configurable failure rates\n- **Custom Responses**: Override responses for specific test scenarios\n- **Multiple Mock Models**: Simulates GPT-4, GPT-3.5, and Claude models\n- **Zero External Dependencies**: Perfect for testing without API keys\n\n## Installation\n\n```bash\nnpm install @anygpt/mock @anygpt/types\n```\n\n## Usage\n\n### Basic Usage\n\n```typescript\nimport { MockConnectorFactory } from '@anygpt/mock';\nimport { GenAIRouter } from '@anygpt/router';\n\nconst router = new GenAIRouter();\nrouter.registerConnector(new MockConnectorFactory());\n\n// Use the mock connector\nconst response = await router.chatCompletion({\n  provider: 'mock',\n  model: 'mock-gpt-4',\n  messages: [{ role: 'user', content: 'Hello!' }]\n});\n```\n\n### Configuration\n\n```typescript\nimport { MockConnector } from '@anygpt/mock';\n\nconst mockConnector = new MockConnector({\n  delay: 500,        // 500ms simulated latency\n  failureRate: 0.1,  // 10% chance of failure\n  customResponses: {\n    'chat_mock-gpt-4': {\n      id: 'custom-response',\n      // ... custom response object\n    }\n  }\n});\n```\n\n### Dynamic Configuration\n\n```typescript\n// In your config file\nexport default {\n  providers: {\n    'test-provider': {\n      connector: '@anygpt/mock',\n      api: { url: 'mock://test' },\n      config: {\n        delay: 200,\n        failureRate: 0.05\n      }\n    }\n  }\n};\n```\n\n### Testing Utilities\n\n```typescript\nconst mockConnector = new MockConnector();\n\n// Set custom responses for testing\nmockConnector.setCustomResponse('chat_test-model', {\n  id: 'test-123',\n  choices: [{ message: { content: 'Expected test response' } }]\n});\n\n// Simulate network issues\nmockConnector.setFailureRate(0.5); // 50% failure rate\nmockConnector.setDelay(2000);      // 2 second delay\n```\n\n## Mock Models\n\nThe connector provides several mock models:\n\n- **mock-gpt-4**: High-capability model simulation\n- **mock-gpt-3.5-turbo**: Fast model simulation  \n- **mock-claude-3**: Vision-capable model simulation\n\n## Configuration Options\n\n- `delay`: Simulated API response delay in milliseconds (default: 100)\n- `failureRate`: Probability of simulated failures (0-1, default: 0)\n- `customResponses`: Override responses for specific scenarios\n- `timeout`: Request timeout (inherited from base config)\n- `maxRetries`: Maximum retry attempts (inherited from base config)\n\n## Use Cases\n\n- **Unit Testing**: Test your application without external API calls\n- **Development**: Develop against consistent, predictable responses\n- **Integration Testing**: Test error handling and retry logic\n- **Performance Testing**: Simulate various latency scenarios\n- **Offline Development**: Work without internet connectivity\n\n## Response Patterns\n\nThe mock connector generates contextual responses:\n\n- **Hello messages**: Returns friendly greetings\n- **Test queries**: Confirms testing functionality\n- **Error keywords**: Simulates error scenarios\n- **Default**: Random contextual responses\n\nThis makes testing more realistic while remaining predictable for assertions.\n","readmeFilename":"README.md"}