@bluefly/openstandardagents 0.4.0 → 0.4.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 +117 -0
- package/DEMO.md +212 -0
- package/README.md +75 -15
- package/dist/adapters/drupal/generator.d.ts +149 -0
- package/dist/adapters/drupal/generator.d.ts.map +1 -0
- package/dist/adapters/drupal/generator.js +1760 -0
- package/dist/adapters/drupal/generator.js.map +1 -0
- package/dist/adapters/drupal/index.d.ts +2 -0
- package/dist/adapters/drupal/index.d.ts.map +1 -1
- package/dist/adapters/drupal/index.js +3 -0
- package/dist/adapters/drupal/index.js.map +1 -1
- package/dist/adapters/npm/adapter.js +2 -2
- package/dist/adapters/npm/converter.js +3 -3
- package/dist/cli/banner.d.ts +21 -0
- package/dist/cli/banner.d.ts.map +1 -0
- package/dist/cli/banner.js +128 -0
- package/dist/cli/banner.js.map +1 -0
- package/dist/cli/commands/dev.command.d.ts +20 -0
- package/dist/cli/commands/dev.command.d.ts.map +1 -0
- package/dist/cli/commands/dev.command.js +78 -0
- package/dist/cli/commands/dev.command.js.map +1 -0
- package/dist/cli/commands/estimate.command.d.ts +12 -0
- package/dist/cli/commands/estimate.command.d.ts.map +1 -0
- package/dist/cli/commands/estimate.command.js +226 -0
- package/dist/cli/commands/estimate.command.js.map +1 -0
- package/dist/cli/commands/export-enhanced.command.d.ts +7 -0
- package/dist/cli/commands/export-enhanced.command.d.ts.map +1 -0
- package/dist/cli/commands/{export-v2.command.js → export-enhanced.command.js} +3 -3
- package/dist/cli/commands/export-enhanced.command.js.map +1 -0
- package/dist/cli/commands/export.command.d.ts.map +1 -1
- package/dist/cli/commands/export.command.js +82 -4
- package/dist/cli/commands/export.command.js.map +1 -1
- package/dist/cli/commands/init.command.d.ts.map +1 -1
- package/dist/cli/commands/init.command.js +2 -0
- package/dist/cli/commands/init.command.js.map +1 -1
- package/dist/cli/commands/test.command.d.ts +1 -0
- package/dist/cli/commands/test.command.d.ts.map +1 -1
- package/dist/cli/commands/test.command.js +172 -105
- package/dist/cli/commands/test.command.js.map +1 -1
- package/dist/cli/commands/types/wizard-config.types.d.ts +59 -0
- package/dist/cli/commands/types/wizard-config.types.d.ts.map +1 -0
- package/dist/cli/commands/types/wizard-config.types.js +34 -0
- package/dist/cli/commands/types/wizard-config.types.js.map +1 -0
- package/dist/cli/commands/upgrade.command.d.ts +9 -0
- package/dist/cli/commands/upgrade.command.d.ts.map +1 -0
- package/dist/cli/commands/upgrade.command.js +167 -0
- package/dist/cli/commands/upgrade.command.js.map +1 -0
- package/dist/cli/commands/wizard-api-first.command.d.ts +18 -0
- package/dist/cli/commands/wizard-api-first.command.d.ts.map +1 -0
- package/dist/cli/commands/wizard-api-first.command.js +854 -0
- package/dist/cli/commands/wizard-api-first.command.js.map +1 -0
- package/dist/cli/commands/wizard-interactive.command.d.ts +25 -0
- package/dist/cli/commands/wizard-interactive.command.d.ts.map +1 -0
- package/dist/cli/commands/wizard-interactive.command.js +1875 -0
- package/dist/cli/commands/wizard-interactive.command.js.map +1 -0
- package/dist/cli/commands/workspace.command.js +1 -1
- package/dist/cli/commands/workspace.command.js.map +1 -1
- package/dist/cli/index.js +9 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/schema-driven/index.d.ts +27 -0
- package/dist/cli/schema-driven/index.d.ts.map +1 -0
- package/dist/cli/schema-driven/index.js +34 -0
- package/dist/cli/schema-driven/index.js.map +1 -0
- package/dist/cli/schema-driven/schema-loader.d.ts +115 -0
- package/dist/cli/schema-driven/schema-loader.d.ts.map +1 -0
- package/dist/cli/schema-driven/schema-loader.js +270 -0
- package/dist/cli/schema-driven/schema-loader.js.map +1 -0
- package/dist/cli/schema-driven/ui-generator.d.ts +88 -0
- package/dist/cli/schema-driven/ui-generator.d.ts.map +1 -0
- package/dist/cli/schema-driven/ui-generator.js +326 -0
- package/dist/cli/schema-driven/ui-generator.js.map +1 -0
- package/dist/cli/wizard/interactive-wizard.d.ts +26 -0
- package/dist/cli/wizard/interactive-wizard.d.ts.map +1 -0
- package/dist/cli/wizard/interactive-wizard.js +296 -0
- package/dist/cli/wizard/interactive-wizard.js.map +1 -0
- package/dist/cli/wizard/template-catalog.d.ts +32 -0
- package/dist/cli/wizard/template-catalog.d.ts.map +1 -0
- package/dist/cli/wizard/template-catalog.js +99 -0
- package/dist/cli/wizard/template-catalog.js.map +1 -0
- package/dist/cli/wizard/use-cases.d.ts +37 -0
- package/dist/cli/wizard/use-cases.d.ts.map +1 -0
- package/dist/cli/wizard/use-cases.js +157 -0
- package/dist/cli/wizard/use-cases.js.map +1 -0
- package/dist/di-container.d.ts.map +1 -1
- package/dist/di-container.js +2 -0
- package/dist/di-container.js.map +1 -1
- package/dist/package.json +19 -9
- package/dist/runtime/agent-runner.d.ts +46 -0
- package/dist/runtime/agent-runner.d.ts.map +1 -0
- package/dist/runtime/agent-runner.js +346 -0
- package/dist/runtime/agent-runner.js.map +1 -0
- package/dist/sdks/kagent/crd-generator.d.ts +4 -0
- package/dist/sdks/kagent/crd-generator.d.ts.map +1 -1
- package/dist/sdks/kagent/crd-generator.js +83 -2
- package/dist/sdks/kagent/crd-generator.js.map +1 -1
- package/dist/sdks/kagent/k8s-resources-generator.d.ts +73 -0
- package/dist/sdks/kagent/k8s-resources-generator.d.ts.map +1 -0
- package/dist/sdks/kagent/k8s-resources-generator.js +286 -0
- package/dist/sdks/kagent/k8s-resources-generator.js.map +1 -0
- package/dist/sdks/kagent/types.d.ts +79 -0
- package/dist/sdks/kagent/types.d.ts.map +1 -1
- package/dist/sdks/shared/validation.d.ts +2 -2
- package/dist/services/cost-estimation/optimization-patterns.d.ts +23 -0
- package/dist/services/cost-estimation/optimization-patterns.d.ts.map +1 -0
- package/dist/services/cost-estimation/optimization-patterns.js +147 -0
- package/dist/services/cost-estimation/optimization-patterns.js.map +1 -0
- package/dist/services/cost-estimation/pricing.d.ts +29 -0
- package/dist/services/cost-estimation/pricing.d.ts.map +1 -0
- package/dist/services/cost-estimation/pricing.js +225 -0
- package/dist/services/cost-estimation/pricing.js.map +1 -0
- package/dist/services/cost-estimation/scenario-estimator.d.ts +59 -0
- package/dist/services/cost-estimation/scenario-estimator.d.ts.map +1 -0
- package/dist/services/cost-estimation/scenario-estimator.js +145 -0
- package/dist/services/cost-estimation/scenario-estimator.js.map +1 -0
- package/dist/services/cost-estimation/token-counter.service.d.ts +51 -0
- package/dist/services/cost-estimation/token-counter.service.d.ts.map +1 -0
- package/dist/services/cost-estimation/token-counter.service.js +125 -0
- package/dist/services/cost-estimation/token-counter.service.js.map +1 -0
- package/dist/services/dev-server/dev-server.service.d.ts +121 -0
- package/dist/services/dev-server/dev-server.service.d.ts.map +1 -0
- package/dist/services/dev-server/dev-server.service.js +290 -0
- package/dist/services/dev-server/dev-server.service.js.map +1 -0
- package/dist/services/dev-server/file-watcher.d.ts +101 -0
- package/dist/services/dev-server/file-watcher.d.ts.map +1 -0
- package/dist/services/dev-server/file-watcher.js +190 -0
- package/dist/services/dev-server/file-watcher.js.map +1 -0
- package/dist/services/dev-server/live-validator.d.ts +157 -0
- package/dist/services/dev-server/live-validator.d.ts.map +1 -0
- package/dist/services/dev-server/live-validator.js +301 -0
- package/dist/services/dev-server/live-validator.js.map +1 -0
- package/dist/services/dev-server/websocket-server.d.ts +137 -0
- package/dist/services/dev-server/websocket-server.d.ts.map +1 -0
- package/dist/services/dev-server/websocket-server.js +229 -0
- package/dist/services/dev-server/websocket-server.js.map +1 -0
- package/dist/services/export/anthropic/anthropic-exporter.d.ts +70 -0
- package/dist/services/export/anthropic/anthropic-exporter.d.ts.map +1 -0
- package/dist/services/export/anthropic/anthropic-exporter.js +576 -0
- package/dist/services/export/anthropic/anthropic-exporter.js.map +1 -0
- package/dist/services/export/anthropic/api-generator.d.ts +39 -0
- package/dist/services/export/anthropic/api-generator.d.ts.map +1 -0
- package/dist/services/export/anthropic/api-generator.js +395 -0
- package/dist/services/export/anthropic/api-generator.js.map +1 -0
- package/dist/services/export/anthropic/index.d.ts +18 -0
- package/dist/services/export/anthropic/index.d.ts.map +1 -0
- package/dist/services/export/anthropic/index.js +16 -0
- package/dist/services/export/anthropic/index.js.map +1 -0
- package/dist/services/export/anthropic/tools-generator.d.ts +35 -0
- package/dist/services/export/anthropic/tools-generator.d.ts.map +1 -0
- package/dist/services/export/anthropic/tools-generator.js +260 -0
- package/dist/services/export/anthropic/tools-generator.js.map +1 -0
- package/dist/services/export/langchain/api-generator.d.ts +17 -0
- package/dist/services/export/langchain/api-generator.d.ts.map +1 -0
- package/dist/services/export/langchain/api-generator.js +375 -0
- package/dist/services/export/langchain/api-generator.js.map +1 -0
- package/dist/services/export/langchain/callbacks-generator.d.ts +63 -0
- package/dist/services/export/langchain/callbacks-generator.d.ts.map +1 -0
- package/dist/services/export/langchain/callbacks-generator.js +408 -0
- package/dist/services/export/langchain/callbacks-generator.js.map +1 -0
- package/dist/services/export/langchain/error-handling-generator.d.ts +76 -0
- package/dist/services/export/langchain/error-handling-generator.d.ts.map +1 -0
- package/dist/services/export/langchain/error-handling-generator.js +522 -0
- package/dist/services/export/langchain/error-handling-generator.js.map +1 -0
- package/dist/services/export/langchain/index.d.ts +17 -0
- package/dist/services/export/langchain/index.d.ts.map +1 -0
- package/dist/services/export/langchain/index.js +13 -0
- package/dist/services/export/langchain/index.js.map +1 -0
- package/dist/services/export/langchain/langchain-exporter.d.ts +174 -0
- package/dist/services/export/langchain/langchain-exporter.d.ts.map +1 -0
- package/dist/services/export/langchain/langchain-exporter.js +953 -0
- package/dist/services/export/langchain/langchain-exporter.js.map +1 -0
- package/dist/services/export/langchain/langgraph-generator.d.ts +86 -0
- package/dist/services/export/langchain/langgraph-generator.d.ts.map +1 -0
- package/dist/services/export/langchain/langgraph-generator.js +473 -0
- package/dist/services/export/langchain/langgraph-generator.js.map +1 -0
- package/dist/services/export/langchain/langserve-generator.d.ts +95 -0
- package/dist/services/export/langchain/langserve-generator.d.ts.map +1 -0
- package/dist/services/export/langchain/langserve-generator.js +807 -0
- package/dist/services/export/langchain/langserve-generator.js.map +1 -0
- package/dist/services/export/langchain/memory-generator.d.ts +71 -0
- package/dist/services/export/langchain/memory-generator.d.ts.map +1 -0
- package/dist/services/export/langchain/memory-generator.js +1182 -0
- package/dist/services/export/langchain/memory-generator.js.map +1 -0
- package/dist/services/export/langchain/openapi-generator.d.ts +20 -0
- package/dist/services/export/langchain/openapi-generator.d.ts.map +1 -0
- package/dist/services/export/langchain/openapi-generator.js +364 -0
- package/dist/services/export/langchain/openapi-generator.js.map +1 -0
- package/dist/services/export/langchain/plan-execute-generator.d.ts +60 -0
- package/dist/services/export/langchain/plan-execute-generator.d.ts.map +1 -0
- package/dist/services/export/langchain/plan-execute-generator.js +679 -0
- package/dist/services/export/langchain/plan-execute-generator.js.map +1 -0
- package/dist/services/export/langchain/streaming-generator.d.ts +66 -0
- package/dist/services/export/langchain/streaming-generator.d.ts.map +1 -0
- package/dist/services/export/langchain/streaming-generator.js +749 -0
- package/dist/services/export/langchain/streaming-generator.js.map +1 -0
- package/dist/services/export/langchain/tools-generator.d.ts +67 -0
- package/dist/services/export/langchain/tools-generator.d.ts.map +1 -0
- package/dist/services/export/langchain/tools-generator.js +543 -0
- package/dist/services/export/langchain/tools-generator.js.map +1 -0
- package/dist/services/export/npm/express-generator.d.ts +23 -0
- package/dist/services/export/npm/express-generator.d.ts.map +1 -0
- package/dist/services/export/npm/express-generator.js +296 -0
- package/dist/services/export/npm/express-generator.js.map +1 -0
- package/dist/services/export/npm/index.d.ts +13 -0
- package/dist/services/export/npm/index.d.ts.map +1 -0
- package/dist/services/export/npm/index.js +11 -0
- package/dist/services/export/npm/index.js.map +1 -0
- package/dist/services/export/npm/npm-exporter.d.ts +142 -0
- package/dist/services/export/npm/npm-exporter.d.ts.map +1 -0
- package/dist/services/export/npm/npm-exporter.js +480 -0
- package/dist/services/export/npm/npm-exporter.js.map +1 -0
- package/dist/services/export/npm/openapi-generator.d.ts +19 -0
- package/dist/services/export/npm/openapi-generator.d.ts.map +1 -0
- package/dist/services/export/npm/openapi-generator.js +428 -0
- package/dist/services/export/npm/openapi-generator.js.map +1 -0
- package/dist/services/export/npm/package-json-generator.d.ts +31 -0
- package/dist/services/export/npm/package-json-generator.d.ts.map +1 -0
- package/dist/services/export/npm/package-json-generator.js +153 -0
- package/dist/services/export/npm/package-json-generator.js.map +1 -0
- package/dist/services/export/npm/typescript-generator.d.ts +69 -0
- package/dist/services/export/npm/typescript-generator.d.ts.map +1 -0
- package/dist/services/export/npm/typescript-generator.js +437 -0
- package/dist/services/export/npm/typescript-generator.js.map +1 -0
- package/dist/services/export/testing/index.d.ts +8 -0
- package/dist/services/export/testing/index.d.ts.map +1 -0
- package/dist/services/export/testing/index.js +7 -0
- package/dist/services/export/testing/index.js.map +1 -0
- package/dist/services/export/testing/test-generator.d.ts +178 -0
- package/dist/services/export/testing/test-generator.d.ts.map +1 -0
- package/dist/services/export/testing/test-generator.js +2542 -0
- package/dist/services/export/testing/test-generator.js.map +1 -0
- package/dist/services/test-runner/mock-llm.service.d.ts +77 -0
- package/dist/services/test-runner/mock-llm.service.d.ts.map +1 -0
- package/dist/services/test-runner/mock-llm.service.js +173 -0
- package/dist/services/test-runner/mock-llm.service.js.map +1 -0
- package/dist/services/test-runner/scenarios.d.ts +36 -0
- package/dist/services/test-runner/scenarios.d.ts.map +1 -0
- package/dist/services/test-runner/scenarios.js +196 -0
- package/dist/services/test-runner/scenarios.js.map +1 -0
- package/dist/services/test-runner/test-runner.service.d.ts +19 -1
- package/dist/services/test-runner/test-runner.service.d.ts.map +1 -1
- package/dist/services/test-runner/test-runner.service.js +72 -6
- package/dist/services/test-runner/test-runner.service.js.map +1 -1
- package/dist/services/validation/best-practices-validator.d.ts +84 -0
- package/dist/services/validation/best-practices-validator.d.ts.map +1 -0
- package/dist/services/validation/best-practices-validator.js +499 -0
- package/dist/services/validation/best-practices-validator.js.map +1 -0
- package/dist/services/validation/cost-estimator.d.ts +69 -0
- package/dist/services/validation/cost-estimator.d.ts.map +1 -0
- package/dist/services/validation/cost-estimator.js +221 -0
- package/dist/services/validation/cost-estimator.js.map +1 -0
- package/dist/services/validation/enhanced-validator.d.ts +78 -0
- package/dist/services/validation/enhanced-validator.d.ts.map +1 -0
- package/dist/services/validation/enhanced-validator.js +212 -0
- package/dist/services/validation/enhanced-validator.js.map +1 -0
- package/dist/services/validation/index.d.ts +13 -0
- package/dist/services/validation/index.d.ts.map +1 -0
- package/dist/services/validation/index.js +9 -0
- package/dist/services/validation/index.js.map +1 -0
- package/dist/services/validation/security-validator.d.ts +81 -0
- package/dist/services/validation/security-validator.d.ts.map +1 -0
- package/dist/services/validation/security-validator.js +328 -0
- package/dist/services/validation/security-validator.js.map +1 -0
- package/dist/services/wizard/prompts.d.ts +71 -0
- package/dist/services/wizard/prompts.d.ts.map +1 -0
- package/dist/services/wizard/prompts.js +322 -0
- package/dist/services/wizard/prompts.js.map +1 -0
- package/dist/services/wizard/wizard.service.d.ts +60 -0
- package/dist/services/wizard/wizard.service.d.ts.map +1 -0
- package/dist/services/wizard/wizard.service.js +261 -0
- package/dist/services/wizard/wizard.service.js.map +1 -0
- package/dist/types/personality.zod.d.ts +23 -23
- package/dist/utils/version.d.ts +1 -1
- package/dist/utils/version.js +1 -1
- package/dist/version-management/core/version-manager.test.js.map +1 -1
- package/dist/version.d.ts +62 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +73 -0
- package/dist/version.js.map +1 -0
- package/examples/a2a/agent-handoff.ossa.yaml +1 -1
- package/examples/a2a/service-discovery.ossa.yaml +1 -1
- package/examples/adapters/drupal-eca-mapping.yaml +1 -1
- package/examples/adapters/drupal-eca-task.yaml +1 -1
- package/examples/adapters/drupal-flowdrop-mapping.yaml +1 -1
- package/examples/adapters/drupal-maestro-mapping.yaml +1 -1
- package/examples/adapters/mistral-agent.yaml +1 -1
- package/examples/adapters/symfony-messenger-task.yaml +1 -1
- package/examples/adapters/symfony-messenger-workflow.yaml +1 -1
- package/examples/adk-integration/code-review-workflow.yml +1 -1
- package/examples/adk-integration/customer-support.yml +1 -1
- package/examples/adk-integration/data-pipeline.yml +1 -1
- package/examples/advanced/reasoning-agent.yaml +1 -1
- package/examples/advanced/workflows/hybrid-model-strategy.yaml +1 -1
- package/examples/agent-manifests/critics/critic-agent.yaml +1 -1
- package/examples/agent-manifests/governors/governor-agent.yaml +1 -1
- package/examples/agent-manifests/integrators/integrator-agent.yaml +1 -1
- package/examples/agent-manifests/judges/judge-agent.yaml +1 -1
- package/examples/agent-manifests/monitors/monitor-agent.yaml +1 -1
- package/examples/agent-manifests/orchestrators/orchestrator-agent.yaml +1 -1
- package/examples/agent-manifests/sample-compliant-agent.yaml +1 -1
- package/examples/agent-manifests/workers/worker-agent.yaml +1 -1
- package/examples/agents/01-customer-support-bot/.env.example +32 -0
- package/examples/agents/01-customer-support-bot/Dockerfile +30 -0
- package/examples/agents/01-customer-support-bot/README.md +295 -0
- package/examples/agents/01-customer-support-bot/agent.ossa.yaml +172 -0
- package/examples/agents/01-customer-support-bot/docker-compose.yml +55 -0
- package/examples/agents/01-customer-support-bot/openapi.yaml +238 -0
- package/examples/agents/01-customer-support-bot/package.json +48 -0
- package/examples/agents/02-code-review-agent/README.md +72 -0
- package/examples/agents/02-code-review-agent/agent.ossa.yaml +239 -0
- package/examples/agents/02-code-review-agent/docker-compose.yml +22 -0
- package/examples/agents/02-code-review-agent/openapi.yaml +150 -0
- package/examples/agents/03-data-analysis-agent/README.md +51 -0
- package/examples/agents/03-data-analysis-agent/agent.ossa.yaml +97 -0
- package/examples/agents/03-data-analysis-agent/openapi.yaml +74 -0
- package/examples/agents/04-content-moderator/README.md +55 -0
- package/examples/agents/04-content-moderator/agent.ossa.yaml +131 -0
- package/examples/agents/04-content-moderator/openapi.yaml +50 -0
- package/examples/agents/05-sales-assistant/README.md +37 -0
- package/examples/agents/05-sales-assistant/agent.ossa.yaml +146 -0
- package/examples/agents/05-sales-assistant/openapi.yaml +59 -0
- package/examples/agents/06-devops-agent/README.md +39 -0
- package/examples/agents/06-devops-agent/agent.ossa.yaml +141 -0
- package/examples/agents/06-devops-agent/openapi.yaml +51 -0
- package/examples/agents/07-research-assistant/README.md +31 -0
- package/examples/agents/07-research-assistant/agent.ossa.yaml +119 -0
- package/examples/agents/07-research-assistant/openapi.yaml +56 -0
- package/examples/agents/08-email-triage-agent/README.md +33 -0
- package/examples/agents/08-email-triage-agent/agent.ossa.yaml +133 -0
- package/examples/agents/08-email-triage-agent/openapi.yaml +41 -0
- package/examples/agents/09-security-scanner/README.md +49 -0
- package/examples/agents/09-security-scanner/agent.ossa.yaml +174 -0
- package/examples/agents/09-security-scanner/openapi.yaml +46 -0
- package/examples/agents/10-meeting-assistant/README.md +53 -0
- package/examples/agents/10-meeting-assistant/agent.ossa.yaml +211 -0
- package/examples/agents/10-meeting-assistant/docker-compose.yml +27 -0
- package/examples/agents/10-meeting-assistant/openapi.yaml +131 -0
- package/examples/agents/COMPLETION_REPORT.txt +272 -0
- package/examples/agents/INDEX.md +296 -0
- package/examples/agents/README.md +452 -0
- package/examples/agents/SUMMARY.md +362 -0
- package/examples/agents/TEST_RESULTS.md +458 -0
- package/examples/agents/architecture-healer-enterprise.yaml +1 -1
- package/examples/agents/dependency-healer-npm.yaml +1 -1
- package/examples/agents/spec-healer-openapi.yaml +1 -1
- package/examples/agents/wiki-healer-production.yaml +1 -1
- package/examples/agents-md/code-agent.ossa.json +1 -1
- package/examples/agents-md/monorepo-agent.ossa.yaml +1 -1
- package/examples/anthropic/claude-assistant.ossa.json +1 -1
- package/examples/autogen/multi-agent.ossa.json +1 -1
- package/examples/autonomous-evolution/self-evolving-agent.ossa.yaml +1 -1
- package/examples/build-once-use-everywhere/agent.ossa.yaml +1 -1
- package/examples/claude-code/code-reviewer.ossa.yaml +1 -1
- package/examples/claude-code/ossa-validator.ossa.yaml +1 -1
- package/examples/common_npm/agent-router.ossa.yaml +2 -2
- package/examples/contracts/data-consumer.ossa.yaml +1 -1
- package/examples/contracts/data-producer-v2.ossa.yaml +1 -1
- package/examples/contracts/data-producer.ossa.yaml +1 -1
- package/examples/crewai/research-team.ossa.json +1 -1
- package/examples/cursor/code-review-agent.ossa.json +1 -1
- package/examples/drupal/QUICKSTART.md +439 -0
- package/examples/drupal/ai_agents_ossa-module/.agents/example-agent/agent.ossa.yaml +1 -1
- package/examples/drupal/content-moderator.ossa.yaml +107 -0
- package/examples/drupal/gitlab-ml-recommender.ossa.yaml +2 -2
- package/examples/economics/marketplace-agent.ossa.json +1 -1
- package/examples/export/langchain/production-agent-with-memory/README.md +373 -0
- package/examples/export/langchain/production-agent-with-memory/agent.ossa.yaml +97 -0
- package/examples/export/langchain/production-agent-with-streaming/README.md +617 -0
- package/examples/export/langchain/production-agent-with-streaming/agent.ossa.yaml +100 -0
- package/examples/export/langchain/production-agent-with-streaming/client-example.py +263 -0
- package/examples/export/langchain/production-agent-with-tools/README.md +296 -0
- package/examples/export/langchain/production-agent-with-tools/agent.ossa.yaml +216 -0
- package/examples/export/langchain-export-example.ts +246 -0
- package/examples/export/langserve-export-example.ts +246 -0
- package/examples/export/test-generation-example.ts +457 -0
- package/examples/extensions/agents-md-advanced.yml +1 -1
- package/examples/extensions/agents-md-basic.yml +1 -1
- package/examples/extensions/agents-md-sync.yml +1 -1
- package/examples/extensions/agents-md-v1.yml +1 -1
- package/examples/extensions/drupal-v1.yml +1 -1
- package/examples/extensions/encryption-multi-provider.yaml +4 -4
- package/examples/extensions/kagent-v1.yml +1 -1
- package/examples/extensions/knowledge-sources.yaml +1 -1
- package/examples/extensions/mcp-full-featured.yaml +1 -1
- package/examples/genetics/breeding-agent.ossa.json +1 -1
- package/examples/getting-started/01-minimal-agent.ossa.yaml +1 -1
- package/examples/getting-started/02-agent-with-tools.ossa.yaml +1 -1
- package/examples/getting-started/03-agent-with-safety.ossa.yaml +1 -1
- package/examples/getting-started/04-agent-with-messaging.ossa.yaml +1 -1
- package/examples/getting-started/05-workflow-composition.ossa.yaml +1 -1
- package/examples/getting-started/hello-world-complete.ossa.yaml +1 -1
- package/examples/integration-patterns/agent-to-agent-orchestration.ossa.yaml +1 -1
- package/examples/kagent/compliance-validator.ossa.yaml +1 -1
- package/examples/kagent/cost-optimizer.ossa.yaml +1 -1
- package/examples/kagent/documentation-agent.ossa.yaml +1 -1
- package/examples/kagent/k8s-troubleshooter-v1.ossa.yaml +2 -2
- package/examples/kagent/k8s-troubleshooter.ossa.yaml +1 -1
- package/examples/kagent/security-scanner.ossa.yaml +1 -1
- package/examples/langchain/chain-agent.ossa.json +1 -1
- package/examples/langflow/workflow-agent.ossa.json +1 -1
- package/examples/langgraph/state-machine-agent.ossa.json +1 -1
- package/examples/lifecycle/mentoring-agent.ossa.json +1 -1
- package/examples/llamaindex/rag-agent.ossa.json +1 -1
- package/examples/mcp/database-mcp.ossa.yaml +1 -1
- package/examples/mcp/filesystem-mcp.ossa.yaml +1 -1
- package/examples/messaging/dependency-healer.ossa.yaml +1 -1
- package/examples/messaging/incident-responder.ossa.yaml +1 -1
- package/examples/messaging/routing-rules.ossa.yaml +1 -1
- package/examples/messaging/security-scanner.ossa.yaml +1 -1
- package/examples/migration-guides/from-langchain-to-ossa.yaml +4 -4
- package/examples/migrations/langchain/01-python-react-agent-after.ossa.yaml +1 -1
- package/examples/migrations/langchain/02-typescript-conversational-after.ossa.yaml +1 -1
- package/examples/migrations/langchain/03-sequential-chain-after.ossa.yaml +1 -1
- package/examples/migrations/langchain/04-config-based-after.ossa.yaml +1 -1
- package/examples/migrations/swarm-to-ossa/after-handoffs.ossa.yaml +6 -6
- package/examples/migrations/swarm-to-ossa/after-triage-agent.ossa.yaml +3 -3
- package/examples/multi-agent/conditional-router.ossa.yaml +1 -1
- package/examples/multi-agent/parallel-execution.ossa.yaml +1 -1
- package/examples/multi-agent/sequential-pipeline.ossa.yaml +1 -1
- package/examples/multi-agent-research-workflow.ossa.yaml +133 -0
- package/examples/multi-platform/single-manifest/agent.ossa.yaml +1 -1
- package/examples/npm-export-example.ts +150 -0
- package/examples/observability/activity-stream-full.yaml +1 -1
- package/examples/openai/basic-agent.ossa.yaml +1 -1
- package/examples/openai/multi-tool-agent.ossa.json +1 -1
- package/examples/openai/swarm-agent.ossa.json +1 -1
- package/examples/ossa-templates/01-code-assistant.ossa.yaml +1 -1
- package/examples/ossa-templates/02-security-scanner.ossa.yaml +1 -1
- package/examples/ossa-templates/03-ci-pipeline.ossa.yaml +1 -1
- package/examples/ossa-templates/04-code-reviewer.ossa.yaml +1 -1
- package/examples/ossa-templates/05-doc-generator.ossa.yaml +1 -1
- package/examples/ossa-templates/06-compliance-validator.ossa.yaml +1 -1
- package/examples/ossa-templates/07-workflow-orchestrator.ossa.yaml +1 -1
- package/examples/ossa-templates/08-content-writer.ossa.yaml +1 -1
- package/examples/ossa-templates/09-test-generator.ossa.yaml +1 -1
- package/examples/ossa-templates/10-data-transformer.ossa.yaml +1 -1
- package/examples/ossa-templates/11-react-performance-expert.ossa.yaml +1 -1
- package/examples/ossa-templates/12-typescript-type-safety-expert.ossa.yaml +1 -1
- package/examples/ossa-templates/13-accessibility-champion.ossa.yaml +1 -1
- package/examples/ossa-templates/14-security-hardening-agent.ossa.yaml +1 -1
- package/examples/production/document-analyzer-openai.yml +1 -1
- package/examples/production-ready/01-customer-support-bot/.env.example +32 -0
- package/examples/production-ready/01-customer-support-bot/Dockerfile +30 -0
- package/examples/production-ready/01-customer-support-bot/README.md +295 -0
- package/examples/production-ready/01-customer-support-bot/agent.ossa.yaml +172 -0
- package/examples/production-ready/01-customer-support-bot/docker-compose.yml +55 -0
- package/examples/production-ready/01-customer-support-bot/openapi.yaml +238 -0
- package/examples/production-ready/01-customer-support-bot/package.json +48 -0
- package/examples/production-ready/02-code-review-agent/README.md +72 -0
- package/examples/production-ready/02-code-review-agent/agent.ossa.yaml +239 -0
- package/examples/production-ready/02-code-review-agent/docker-compose.yml +22 -0
- package/examples/production-ready/02-code-review-agent/openapi.yaml +150 -0
- package/examples/production-ready/03-data-analysis-agent/README.md +51 -0
- package/examples/production-ready/03-data-analysis-agent/agent.ossa.yaml +97 -0
- package/examples/production-ready/03-data-analysis-agent/openapi.yaml +74 -0
- package/examples/production-ready/04-content-moderator/README.md +55 -0
- package/examples/production-ready/04-content-moderator/agent.ossa.yaml +131 -0
- package/examples/production-ready/04-content-moderator/openapi.yaml +50 -0
- package/examples/production-ready/05-sales-assistant/README.md +37 -0
- package/examples/production-ready/05-sales-assistant/agent.ossa.yaml +146 -0
- package/examples/production-ready/05-sales-assistant/openapi.yaml +59 -0
- package/examples/production-ready/06-devops-agent/README.md +39 -0
- package/examples/production-ready/06-devops-agent/agent.ossa.yaml +141 -0
- package/examples/production-ready/06-devops-agent/openapi.yaml +51 -0
- package/examples/production-ready/07-research-assistant/README.md +31 -0
- package/examples/production-ready/07-research-assistant/agent.ossa.yaml +119 -0
- package/examples/production-ready/07-research-assistant/openapi.yaml +56 -0
- package/examples/production-ready/08-email-triage-agent/README.md +33 -0
- package/examples/production-ready/08-email-triage-agent/agent.ossa.yaml +133 -0
- package/examples/production-ready/08-email-triage-agent/openapi.yaml +41 -0
- package/examples/production-ready/09-security-scanner/README.md +49 -0
- package/examples/production-ready/09-security-scanner/agent.ossa.yaml +174 -0
- package/examples/production-ready/09-security-scanner/openapi.yaml +46 -0
- package/examples/production-ready/10-meeting-assistant/README.md +53 -0
- package/examples/production-ready/10-meeting-assistant/agent.ossa.yaml +211 -0
- package/examples/production-ready/10-meeting-assistant/docker-compose.yml +27 -0
- package/examples/production-ready/10-meeting-assistant/openapi.yaml +131 -0
- package/examples/production-ready/COMPLETION_REPORT.txt +272 -0
- package/examples/production-ready/INDEX.md +296 -0
- package/examples/production-ready/README.md +452 -0
- package/examples/production-ready/SUMMARY.md +362 -0
- package/examples/production-ready/TEST_RESULTS.md +458 -0
- package/examples/quickstart/support-agent.ossa.yaml +1 -1
- package/examples/real-world/gitlab-cicd-optimizer.ossa.yaml +1 -1
- package/examples/real-world/rag-documentation-assistant.ossa.yaml +1 -1
- package/examples/registry/agents/code-reviewer/agent.yaml +1 -1
- package/examples/registry/agents/security-scanner/agent.yaml +1 -1
- package/examples/runtime-adapters/bedrock-claude-example.ossa.yaml +1 -1
- package/examples/schema/reusable-components.yaml +1 -1
- package/examples/showcase/ci-pipeline.ossa.yaml +1 -1
- package/examples/showcase/code-assistant.ossa.yaml +1 -1
- package/examples/showcase/code-reviewer.ossa.yaml +1 -1
- package/examples/showcase/compliance-validator.ossa.yaml +1 -1
- package/examples/showcase/content-writer.ossa.yaml +1 -1
- package/examples/showcase/data-transformer.ossa.yaml +1 -1
- package/examples/showcase/doc-generator.ossa.yaml +1 -1
- package/examples/showcase/security-scanner.ossa.yaml +1 -1
- package/examples/showcase/test-generator.ossa.yaml +1 -1
- package/examples/showcase/workflow-orchestrator.ossa.yaml +1 -1
- package/examples/skills-example.ossa.yaml +140 -0
- package/examples/swarm/pso-optimizer.ossa.json +1 -1
- package/examples/tasks/batch-email-sender.yaml +1 -1
- package/examples/tasks/data-transform.yaml +1 -1
- package/examples/tasks/publish-content.yaml +1 -1
- package/examples/templates/ossa-compliance.yaml +1 -1
- package/examples/unified/security-scanner.ossa.yaml +1 -1
- package/examples/v0.3.6-features/genetics-breeding-advanced.ossa.yaml +1 -1
- package/examples/v0.3.6-features/genetics-breeding-simple.ossa.yaml +1 -1
- package/examples/v0.3.6-features/genetics-fitness-scoring.ossa.yaml +1 -1
- package/examples/vercel/edge-agent.ossa.json +1 -1
- package/examples/workflows/batch-email-campaign.yaml +1 -1
- package/examples/workflows/content-review-publish.yaml +1 -1
- package/examples/workflows/simple-etl.yaml +1 -1
- package/openapi/cli/openapi.yaml +221 -5
- package/package.json +17 -7
- package/dist/cli/commands/export-v2.command.d.ts +0 -7
- package/dist/cli/commands/export-v2.command.d.ts.map +0 -1
- package/dist/cli/commands/export-v2.command.js.map +0 -1
|
@@ -0,0 +1,807 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LangServe Deployment Generator
|
|
3
|
+
*
|
|
4
|
+
* Generates production-ready LangServe applications for deploying LangChain agents
|
|
5
|
+
* as REST APIs with:
|
|
6
|
+
* - LangServe routes with invoke/batch/stream/stream_log endpoints
|
|
7
|
+
* - Interactive playground UI
|
|
8
|
+
* - Docker deployment configs
|
|
9
|
+
* - Kubernetes manifests
|
|
10
|
+
* - Cloud platform configs (Railway, Render, Fly.io)
|
|
11
|
+
*
|
|
12
|
+
* SOLID: Single Responsibility - LangServe deployment generation
|
|
13
|
+
* DRY: Reusable deployment templates
|
|
14
|
+
* API-First: Auto-generates REST endpoints from agent
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* LangServe Generator
|
|
18
|
+
*/
|
|
19
|
+
export class LangServeGenerator {
|
|
20
|
+
/**
|
|
21
|
+
* Generate LangServe FastAPI application
|
|
22
|
+
*/
|
|
23
|
+
generateApp(manifest, config = {}) {
|
|
24
|
+
const agentName = manifest.metadata?.name || 'agent';
|
|
25
|
+
const description = manifest.metadata?.description || 'AI Agent';
|
|
26
|
+
const version = manifest.metadata?.version || '1.0.0';
|
|
27
|
+
const routePath = config.routePath || '/agent';
|
|
28
|
+
const enableFeedback = config.enableFeedback !== false;
|
|
29
|
+
const enablePublicTraceLink = config.enablePublicTraceLink !== false;
|
|
30
|
+
const enablePlayground = config.enablePlayground !== false;
|
|
31
|
+
return `"""
|
|
32
|
+
LangServe Deployment for ${agentName}
|
|
33
|
+
|
|
34
|
+
${description}
|
|
35
|
+
|
|
36
|
+
This LangServe application provides production-ready REST API endpoints:
|
|
37
|
+
- POST ${routePath}/invoke - Synchronous agent invocation
|
|
38
|
+
- POST ${routePath}/batch - Batch invocation for multiple inputs
|
|
39
|
+
- POST ${routePath}/stream - Streaming responses with Server-Sent Events
|
|
40
|
+
- POST ${routePath}/stream_log - Stream with intermediate steps and tokens
|
|
41
|
+
${enablePlayground ? `- GET ${routePath}/playground - Interactive playground UI` : ''}
|
|
42
|
+
${enableFeedback ? `- POST ${routePath}/feedback - Submit feedback for traces` : ''}
|
|
43
|
+
${enablePublicTraceLink ? `- GET ${routePath}/public_trace_link - Get public trace link` : ''}
|
|
44
|
+
|
|
45
|
+
OpenAPI documentation available at /docs
|
|
46
|
+
LangServe playground available at ${routePath}/playground
|
|
47
|
+
"""
|
|
48
|
+
|
|
49
|
+
from typing import Any, Dict, List, Optional, Union
|
|
50
|
+
from fastapi import FastAPI, HTTPException
|
|
51
|
+
from fastapi.responses import RedirectResponse
|
|
52
|
+
from fastapi.middleware.cors import CORSMiddleware
|
|
53
|
+
from langserve import add_routes
|
|
54
|
+
from langchain.schema.runnable import RunnableConfig
|
|
55
|
+
import uvicorn
|
|
56
|
+
import os
|
|
57
|
+
|
|
58
|
+
from agent import create_agent
|
|
59
|
+
|
|
60
|
+
# Initialize FastAPI app
|
|
61
|
+
app = FastAPI(
|
|
62
|
+
title="${agentName} - LangServe API",
|
|
63
|
+
description="${description}",
|
|
64
|
+
version="${version}",
|
|
65
|
+
docs_url="/docs",
|
|
66
|
+
redoc_url="/redoc",
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
# CORS middleware
|
|
70
|
+
app.add_middleware(
|
|
71
|
+
CORSMiddleware,
|
|
72
|
+
allow_origins=["*"], # Configure for production
|
|
73
|
+
allow_credentials=True,
|
|
74
|
+
allow_methods=["*"],
|
|
75
|
+
allow_headers=["*"],
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
# Create agent instance
|
|
79
|
+
agent = create_agent()
|
|
80
|
+
|
|
81
|
+
# Add LangServe routes
|
|
82
|
+
# This automatically generates:
|
|
83
|
+
# - POST ${routePath}/invoke - Single invocation
|
|
84
|
+
# - POST ${routePath}/batch - Batch processing
|
|
85
|
+
# - POST ${routePath}/stream - Streaming responses
|
|
86
|
+
# - POST ${routePath}/stream_log - Detailed streaming with intermediate steps
|
|
87
|
+
# - GET ${routePath}/playground - Interactive UI (if enabled)
|
|
88
|
+
add_routes(
|
|
89
|
+
app,
|
|
90
|
+
agent,
|
|
91
|
+
path="${routePath}",
|
|
92
|
+
enabled_endpoints=["invoke", "batch", "stream", "stream_log", "playground"],
|
|
93
|
+
enable_feedback_endpoint=${enableFeedback ? 'True' : 'False'},
|
|
94
|
+
enable_public_trace_link_endpoint=${enablePublicTraceLink ? 'True' : 'False'},
|
|
95
|
+
playground_type="default", # or "chat" for chat-style UI
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
@app.get("/")
|
|
100
|
+
async def redirect_to_docs():
|
|
101
|
+
"""
|
|
102
|
+
Redirect root to API documentation
|
|
103
|
+
"""
|
|
104
|
+
return RedirectResponse(url="/docs")
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
@app.get("/health")
|
|
108
|
+
async def health_check():
|
|
109
|
+
"""
|
|
110
|
+
Health check endpoint for load balancers and monitoring
|
|
111
|
+
"""
|
|
112
|
+
return {
|
|
113
|
+
"status": "healthy",
|
|
114
|
+
"agent": "${agentName}",
|
|
115
|
+
"version": "${version}",
|
|
116
|
+
"langserve_endpoints": {
|
|
117
|
+
"invoke": "${routePath}/invoke",
|
|
118
|
+
"batch": "${routePath}/batch",
|
|
119
|
+
"stream": "${routePath}/stream",
|
|
120
|
+
"stream_log": "${routePath}/stream_log",
|
|
121
|
+
"playground": "${routePath}/playground",
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
@app.get("/info")
|
|
127
|
+
async def get_info():
|
|
128
|
+
"""
|
|
129
|
+
Get agent information and capabilities
|
|
130
|
+
"""
|
|
131
|
+
return {
|
|
132
|
+
"name": "${agentName}",
|
|
133
|
+
"description": "${description}",
|
|
134
|
+
"version": "${version}",
|
|
135
|
+
"endpoints": {
|
|
136
|
+
"docs": "/docs",
|
|
137
|
+
"health": "/health",
|
|
138
|
+
"agent_invoke": "${routePath}/invoke",
|
|
139
|
+
"agent_batch": "${routePath}/batch",
|
|
140
|
+
"agent_stream": "${routePath}/stream",
|
|
141
|
+
"agent_stream_log": "${routePath}/stream_log",
|
|
142
|
+
"playground": "${routePath}/playground",
|
|
143
|
+
},
|
|
144
|
+
"features": {
|
|
145
|
+
"streaming": True,
|
|
146
|
+
"batch_processing": True,
|
|
147
|
+
"feedback": ${enableFeedback ? 'True' : 'False'},
|
|
148
|
+
"public_traces": ${enablePublicTraceLink ? 'True' : 'False'},
|
|
149
|
+
"playground": ${enablePlayground ? 'True' : 'False'},
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
if __name__ == "__main__":
|
|
155
|
+
# Get configuration from environment
|
|
156
|
+
port = int(os.getenv("PORT", ${config.port || 8000}))
|
|
157
|
+
host = os.getenv("HOST", "0.0.0.0")
|
|
158
|
+
|
|
159
|
+
print(f"Starting ${agentName} LangServe API on {host}:{port}")
|
|
160
|
+
print(f"API Documentation: http://{host}:{port}/docs")
|
|
161
|
+
print(f"Interactive Playground: http://{host}:{port}${routePath}/playground")
|
|
162
|
+
|
|
163
|
+
uvicorn.run(
|
|
164
|
+
app,
|
|
165
|
+
host=host,
|
|
166
|
+
port=port,
|
|
167
|
+
log_level="info",
|
|
168
|
+
)
|
|
169
|
+
`;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Generate Dockerfile for LangServe
|
|
173
|
+
*/
|
|
174
|
+
generateDockerfile(pythonVersion = '3.11') {
|
|
175
|
+
return `# LangServe Deployment Dockerfile
|
|
176
|
+
FROM python:${pythonVersion}-slim
|
|
177
|
+
|
|
178
|
+
WORKDIR /app
|
|
179
|
+
|
|
180
|
+
# Install system dependencies
|
|
181
|
+
RUN apt-get update && apt-get install -y \\
|
|
182
|
+
gcc \\
|
|
183
|
+
g++ \\
|
|
184
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
185
|
+
|
|
186
|
+
# Copy requirements first (for layer caching)
|
|
187
|
+
COPY requirements.txt .
|
|
188
|
+
|
|
189
|
+
# Install Python dependencies
|
|
190
|
+
RUN pip install --no-cache-dir -r requirements.txt
|
|
191
|
+
|
|
192
|
+
# Copy application code
|
|
193
|
+
COPY . .
|
|
194
|
+
|
|
195
|
+
# Expose LangServe port
|
|
196
|
+
EXPOSE 8000
|
|
197
|
+
|
|
198
|
+
# Health check
|
|
199
|
+
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \\
|
|
200
|
+
CMD python -c "import requests; requests.get('http://localhost:8000/health')"
|
|
201
|
+
|
|
202
|
+
# Run LangServe app
|
|
203
|
+
CMD ["python", "langserve_app.py"]
|
|
204
|
+
`;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Generate docker-compose.yaml for LangServe
|
|
208
|
+
*/
|
|
209
|
+
generateDockerCompose(manifest, config = {}) {
|
|
210
|
+
const agentName = manifest.metadata?.name || 'agent';
|
|
211
|
+
const port = config.port || 8000;
|
|
212
|
+
return `version: '3.8'
|
|
213
|
+
|
|
214
|
+
services:
|
|
215
|
+
${agentName}:
|
|
216
|
+
build: .
|
|
217
|
+
container_name: ${agentName}-langserve
|
|
218
|
+
ports:
|
|
219
|
+
- "${port}:8000"
|
|
220
|
+
environment:
|
|
221
|
+
# LLM API Keys
|
|
222
|
+
- OPENAI_API_KEY=\${OPENAI_API_KEY}
|
|
223
|
+
- ANTHROPIC_API_KEY=\${ANTHROPIC_API_KEY}
|
|
224
|
+
|
|
225
|
+
# LangServe Configuration
|
|
226
|
+
- PORT=8000
|
|
227
|
+
- HOST=0.0.0.0
|
|
228
|
+
|
|
229
|
+
# LangSmith (Optional - for tracing and debugging)
|
|
230
|
+
- LANGCHAIN_TRACING_V2=\${LANGCHAIN_TRACING_V2:-false}
|
|
231
|
+
- LANGCHAIN_API_KEY=\${LANGCHAIN_API_KEY:-}
|
|
232
|
+
- LANGCHAIN_PROJECT=\${LANGCHAIN_PROJECT:-default}
|
|
233
|
+
- LANGCHAIN_ENDPOINT=\${LANGCHAIN_ENDPOINT:-https://api.smith.langchain.com}
|
|
234
|
+
restart: unless-stopped
|
|
235
|
+
healthcheck:
|
|
236
|
+
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
|
|
237
|
+
interval: 30s
|
|
238
|
+
timeout: 10s
|
|
239
|
+
retries: 3
|
|
240
|
+
start_period: 40s
|
|
241
|
+
volumes:
|
|
242
|
+
# Mount for development (optional)
|
|
243
|
+
- ./logs:/app/logs
|
|
244
|
+
networks:
|
|
245
|
+
- langserve-network
|
|
246
|
+
|
|
247
|
+
networks:
|
|
248
|
+
langserve-network:
|
|
249
|
+
driver: bridge
|
|
250
|
+
`;
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Generate Kubernetes deployment manifests
|
|
254
|
+
*/
|
|
255
|
+
generateKubernetesManifests(manifest, config = {}) {
|
|
256
|
+
const agentName = manifest.metadata?.name || 'agent';
|
|
257
|
+
const appLabel = `${agentName}-langserve`;
|
|
258
|
+
const port = config.port || 8000;
|
|
259
|
+
const deployment = `apiVersion: apps/v1
|
|
260
|
+
kind: Deployment
|
|
261
|
+
metadata:
|
|
262
|
+
name: ${appLabel}
|
|
263
|
+
labels:
|
|
264
|
+
app: ${appLabel}
|
|
265
|
+
spec:
|
|
266
|
+
replicas: 2
|
|
267
|
+
selector:
|
|
268
|
+
matchLabels:
|
|
269
|
+
app: ${appLabel}
|
|
270
|
+
template:
|
|
271
|
+
metadata:
|
|
272
|
+
labels:
|
|
273
|
+
app: ${appLabel}
|
|
274
|
+
spec:
|
|
275
|
+
containers:
|
|
276
|
+
- name: ${agentName}
|
|
277
|
+
image: ${appLabel}:latest
|
|
278
|
+
ports:
|
|
279
|
+
- containerPort: 8000
|
|
280
|
+
name: http
|
|
281
|
+
env:
|
|
282
|
+
- name: PORT
|
|
283
|
+
value: "8000"
|
|
284
|
+
- name: HOST
|
|
285
|
+
value: "0.0.0.0"
|
|
286
|
+
- name: OPENAI_API_KEY
|
|
287
|
+
valueFrom:
|
|
288
|
+
secretKeyRef:
|
|
289
|
+
name: ${appLabel}-secrets
|
|
290
|
+
key: openai-api-key
|
|
291
|
+
- name: ANTHROPIC_API_KEY
|
|
292
|
+
valueFrom:
|
|
293
|
+
secretKeyRef:
|
|
294
|
+
name: ${appLabel}-secrets
|
|
295
|
+
key: anthropic-api-key
|
|
296
|
+
optional: true
|
|
297
|
+
- name: LANGCHAIN_API_KEY
|
|
298
|
+
valueFrom:
|
|
299
|
+
secretKeyRef:
|
|
300
|
+
name: ${appLabel}-secrets
|
|
301
|
+
key: langchain-api-key
|
|
302
|
+
optional: true
|
|
303
|
+
resources:
|
|
304
|
+
requests:
|
|
305
|
+
memory: "512Mi"
|
|
306
|
+
cpu: "500m"
|
|
307
|
+
limits:
|
|
308
|
+
memory: "1Gi"
|
|
309
|
+
cpu: "1000m"
|
|
310
|
+
livenessProbe:
|
|
311
|
+
httpGet:
|
|
312
|
+
path: /health
|
|
313
|
+
port: 8000
|
|
314
|
+
initialDelaySeconds: 30
|
|
315
|
+
periodSeconds: 10
|
|
316
|
+
timeoutSeconds: 5
|
|
317
|
+
failureThreshold: 3
|
|
318
|
+
readinessProbe:
|
|
319
|
+
httpGet:
|
|
320
|
+
path: /health
|
|
321
|
+
port: 8000
|
|
322
|
+
initialDelaySeconds: 10
|
|
323
|
+
periodSeconds: 5
|
|
324
|
+
timeoutSeconds: 3
|
|
325
|
+
`;
|
|
326
|
+
const service = `apiVersion: v1
|
|
327
|
+
kind: Service
|
|
328
|
+
metadata:
|
|
329
|
+
name: ${appLabel}
|
|
330
|
+
labels:
|
|
331
|
+
app: ${appLabel}
|
|
332
|
+
spec:
|
|
333
|
+
type: ClusterIP
|
|
334
|
+
ports:
|
|
335
|
+
- port: 80
|
|
336
|
+
targetPort: 8000
|
|
337
|
+
protocol: TCP
|
|
338
|
+
name: http
|
|
339
|
+
selector:
|
|
340
|
+
app: ${appLabel}
|
|
341
|
+
`;
|
|
342
|
+
const ingress = `apiVersion: networking.k8s.io/v1
|
|
343
|
+
kind: Ingress
|
|
344
|
+
metadata:
|
|
345
|
+
name: ${appLabel}
|
|
346
|
+
annotations:
|
|
347
|
+
nginx.ingress.kubernetes.io/rewrite-target: /
|
|
348
|
+
cert-manager.io/cluster-issuer: letsencrypt-prod
|
|
349
|
+
spec:
|
|
350
|
+
ingressClassName: nginx
|
|
351
|
+
tls:
|
|
352
|
+
- hosts:
|
|
353
|
+
- ${agentName}.example.com
|
|
354
|
+
secretName: ${appLabel}-tls
|
|
355
|
+
rules:
|
|
356
|
+
- host: ${agentName}.example.com
|
|
357
|
+
http:
|
|
358
|
+
paths:
|
|
359
|
+
- path: /
|
|
360
|
+
pathType: Prefix
|
|
361
|
+
backend:
|
|
362
|
+
service:
|
|
363
|
+
name: ${appLabel}
|
|
364
|
+
port:
|
|
365
|
+
number: 80
|
|
366
|
+
`;
|
|
367
|
+
return { deployment, service, ingress };
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* Generate Railway configuration
|
|
371
|
+
*/
|
|
372
|
+
generateRailwayConfig(manifest, config = {}) {
|
|
373
|
+
const port = config.port || 8000;
|
|
374
|
+
return `# Railway deployment configuration
|
|
375
|
+
# railway.json
|
|
376
|
+
|
|
377
|
+
{
|
|
378
|
+
"build": {
|
|
379
|
+
"builder": "DOCKERFILE",
|
|
380
|
+
"dockerfilePath": "Dockerfile"
|
|
381
|
+
},
|
|
382
|
+
"deploy": {
|
|
383
|
+
"startCommand": "python langserve_app.py",
|
|
384
|
+
"healthcheckPath": "/health",
|
|
385
|
+
"healthcheckTimeout": 300,
|
|
386
|
+
"restartPolicyType": "ON_FAILURE",
|
|
387
|
+
"restartPolicyMaxRetries": 3
|
|
388
|
+
},
|
|
389
|
+
"env": {
|
|
390
|
+
"PORT": "${port}",
|
|
391
|
+
"HOST": "0.0.0.0"
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
`;
|
|
395
|
+
}
|
|
396
|
+
/**
|
|
397
|
+
* Generate Render configuration
|
|
398
|
+
*/
|
|
399
|
+
generateRenderConfig(manifest, config = {}) {
|
|
400
|
+
const agentName = manifest.metadata?.name || 'agent';
|
|
401
|
+
return `# Render deployment configuration
|
|
402
|
+
# render.yaml
|
|
403
|
+
|
|
404
|
+
services:
|
|
405
|
+
- type: web
|
|
406
|
+
name: ${agentName}-langserve
|
|
407
|
+
runtime: python
|
|
408
|
+
buildCommand: pip install -r requirements.txt
|
|
409
|
+
startCommand: python langserve_app.py
|
|
410
|
+
envVars:
|
|
411
|
+
- key: PORT
|
|
412
|
+
value: 8000
|
|
413
|
+
- key: HOST
|
|
414
|
+
value: 0.0.0.0
|
|
415
|
+
- key: OPENAI_API_KEY
|
|
416
|
+
sync: false
|
|
417
|
+
- key: ANTHROPIC_API_KEY
|
|
418
|
+
sync: false
|
|
419
|
+
- key: LANGCHAIN_API_KEY
|
|
420
|
+
sync: false
|
|
421
|
+
healthCheckPath: /health
|
|
422
|
+
autoDeploy: true
|
|
423
|
+
scaling:
|
|
424
|
+
minInstances: 1
|
|
425
|
+
maxInstances: 3
|
|
426
|
+
`;
|
|
427
|
+
}
|
|
428
|
+
/**
|
|
429
|
+
* Generate Fly.io configuration
|
|
430
|
+
*/
|
|
431
|
+
generateFlyConfig(manifest, config = {}) {
|
|
432
|
+
const agentName = manifest.metadata?.name || 'agent';
|
|
433
|
+
const port = config.port || 8000;
|
|
434
|
+
return `# Fly.io deployment configuration
|
|
435
|
+
# fly.toml
|
|
436
|
+
|
|
437
|
+
app = "${agentName}-langserve"
|
|
438
|
+
primary_region = "iad"
|
|
439
|
+
|
|
440
|
+
[build]
|
|
441
|
+
dockerfile = "Dockerfile"
|
|
442
|
+
|
|
443
|
+
[env]
|
|
444
|
+
PORT = "${port}"
|
|
445
|
+
HOST = "0.0.0.0"
|
|
446
|
+
|
|
447
|
+
[http_service]
|
|
448
|
+
internal_port = ${port}
|
|
449
|
+
force_https = true
|
|
450
|
+
auto_stop_machines = true
|
|
451
|
+
auto_start_machines = true
|
|
452
|
+
min_machines_running = 0
|
|
453
|
+
processes = ["app"]
|
|
454
|
+
|
|
455
|
+
[http_service.concurrency]
|
|
456
|
+
type = "requests"
|
|
457
|
+
hard_limit = 25
|
|
458
|
+
soft_limit = 20
|
|
459
|
+
|
|
460
|
+
[[services]]
|
|
461
|
+
protocol = "tcp"
|
|
462
|
+
internal_port = ${port}
|
|
463
|
+
processes = ["app"]
|
|
464
|
+
|
|
465
|
+
[[services.ports]]
|
|
466
|
+
port = 80
|
|
467
|
+
handlers = ["http"]
|
|
468
|
+
force_https = true
|
|
469
|
+
|
|
470
|
+
[[services.ports]]
|
|
471
|
+
port = 443
|
|
472
|
+
handlers = ["tls", "http"]
|
|
473
|
+
|
|
474
|
+
[services.concurrency]
|
|
475
|
+
type = "requests"
|
|
476
|
+
hard_limit = 25
|
|
477
|
+
soft_limit = 20
|
|
478
|
+
|
|
479
|
+
[[services.tcp_checks]]
|
|
480
|
+
interval = "15s"
|
|
481
|
+
timeout = "2s"
|
|
482
|
+
grace_period = "5s"
|
|
483
|
+
|
|
484
|
+
[[services.http_checks]]
|
|
485
|
+
interval = "10s"
|
|
486
|
+
timeout = "2s"
|
|
487
|
+
grace_period = "5s"
|
|
488
|
+
method = "get"
|
|
489
|
+
path = "/health"
|
|
490
|
+
protocol = "http"
|
|
491
|
+
|
|
492
|
+
[deploy]
|
|
493
|
+
release_command = "python -c \\"print('Deployment starting...')\\"
|
|
494
|
+
`;
|
|
495
|
+
}
|
|
496
|
+
/**
|
|
497
|
+
* Generate LangServe requirements additions
|
|
498
|
+
*/
|
|
499
|
+
generateRequirements() {
|
|
500
|
+
return `# LangServe Deployment
|
|
501
|
+
langserve[all]>=0.0.30
|
|
502
|
+
sse-starlette>=1.8.0
|
|
503
|
+
`;
|
|
504
|
+
}
|
|
505
|
+
/**
|
|
506
|
+
* Generate deployment README
|
|
507
|
+
*/
|
|
508
|
+
generateDeploymentReadme(manifest, config = {}) {
|
|
509
|
+
const agentName = manifest.metadata?.name || 'agent';
|
|
510
|
+
const routePath = config.routePath || '/agent';
|
|
511
|
+
const platforms = config.deploymentPlatforms || ['docker', 'kubernetes', 'railway', 'render', 'fly'];
|
|
512
|
+
let readme = `# ${agentName} - LangServe Deployment Guide
|
|
513
|
+
|
|
514
|
+
This guide covers deploying your LangChain agent using LangServe.
|
|
515
|
+
|
|
516
|
+
## LangServe Features
|
|
517
|
+
|
|
518
|
+
Your agent is deployed with the following endpoints:
|
|
519
|
+
|
|
520
|
+
- **POST ${routePath}/invoke** - Synchronous invocation
|
|
521
|
+
- **POST ${routePath}/batch** - Batch processing (multiple inputs)
|
|
522
|
+
- **POST ${routePath}/stream** - Streaming responses (Server-Sent Events)
|
|
523
|
+
- **POST ${routePath}/stream_log** - Detailed streaming with intermediate steps
|
|
524
|
+
- **GET ${routePath}/playground** - Interactive playground UI
|
|
525
|
+
- **GET /docs** - OpenAPI documentation
|
|
526
|
+
- **GET /health** - Health check endpoint
|
|
527
|
+
|
|
528
|
+
## Quick Start
|
|
529
|
+
|
|
530
|
+
### Local Development
|
|
531
|
+
|
|
532
|
+
\`\`\`bash
|
|
533
|
+
# Install dependencies
|
|
534
|
+
pip install -r requirements.txt
|
|
535
|
+
|
|
536
|
+
# Set environment variables
|
|
537
|
+
export OPENAI_API_KEY="your-key-here"
|
|
538
|
+
export ANTHROPIC_API_KEY="your-key-here"
|
|
539
|
+
|
|
540
|
+
# Run LangServe app
|
|
541
|
+
python langserve_app.py
|
|
542
|
+
|
|
543
|
+
# Access playground
|
|
544
|
+
open http://localhost:8000${routePath}/playground
|
|
545
|
+
\`\`\`
|
|
546
|
+
|
|
547
|
+
## Usage Examples
|
|
548
|
+
|
|
549
|
+
### Invoke Endpoint (Synchronous)
|
|
550
|
+
|
|
551
|
+
\`\`\`bash
|
|
552
|
+
curl -X POST "http://localhost:8000${routePath}/invoke" \\
|
|
553
|
+
-H "Content-Type: application/json" \\
|
|
554
|
+
-d '{"input": "What is LangServe?"}'
|
|
555
|
+
\`\`\`
|
|
556
|
+
|
|
557
|
+
### Batch Endpoint (Multiple Inputs)
|
|
558
|
+
|
|
559
|
+
\`\`\`bash
|
|
560
|
+
curl -X POST "http://localhost:8000${routePath}/batch" \\
|
|
561
|
+
-H "Content-Type: application/json" \\
|
|
562
|
+
-d '{"inputs": ["Question 1?", "Question 2?", "Question 3?"]}'
|
|
563
|
+
\`\`\`
|
|
564
|
+
|
|
565
|
+
### Stream Endpoint (Server-Sent Events)
|
|
566
|
+
|
|
567
|
+
\`\`\`bash
|
|
568
|
+
curl -X POST "http://localhost:8000${routePath}/stream" \\
|
|
569
|
+
-H "Content-Type: application/json" \\
|
|
570
|
+
-d '{"input": "Tell me a story"}' \\
|
|
571
|
+
--no-buffer
|
|
572
|
+
\`\`\`
|
|
573
|
+
|
|
574
|
+
### Stream Log Endpoint (Detailed Streaming)
|
|
575
|
+
|
|
576
|
+
\`\`\`bash
|
|
577
|
+
curl -X POST "http://localhost:8000${routePath}/stream_log" \\
|
|
578
|
+
-H "Content-Type: application/json" \\
|
|
579
|
+
-d '{"input": "Explain LangChain"}' \\
|
|
580
|
+
--no-buffer
|
|
581
|
+
\`\`\`
|
|
582
|
+
|
|
583
|
+
### Interactive Playground
|
|
584
|
+
|
|
585
|
+
Visit: http://localhost:8000${routePath}/playground
|
|
586
|
+
|
|
587
|
+
## Deployment Options
|
|
588
|
+
|
|
589
|
+
`;
|
|
590
|
+
if (platforms.includes('docker')) {
|
|
591
|
+
readme += `### Docker
|
|
592
|
+
|
|
593
|
+
\`\`\`bash
|
|
594
|
+
# Build image
|
|
595
|
+
docker build -t ${agentName}-langserve .
|
|
596
|
+
|
|
597
|
+
# Run container
|
|
598
|
+
docker run -p 8000:8000 \\
|
|
599
|
+
-e OPENAI_API_KEY=your-key \\
|
|
600
|
+
-e ANTHROPIC_API_KEY=your-key \\
|
|
601
|
+
${agentName}-langserve
|
|
602
|
+
|
|
603
|
+
# Or use docker-compose
|
|
604
|
+
docker-compose up
|
|
605
|
+
\`\`\`
|
|
606
|
+
|
|
607
|
+
`;
|
|
608
|
+
}
|
|
609
|
+
if (platforms.includes('kubernetes')) {
|
|
610
|
+
readme += `### Kubernetes
|
|
611
|
+
|
|
612
|
+
\`\`\`bash
|
|
613
|
+
# Create secrets
|
|
614
|
+
kubectl create secret generic ${agentName}-langserve-secrets \\
|
|
615
|
+
--from-literal=openai-api-key=your-key \\
|
|
616
|
+
--from-literal=anthropic-api-key=your-key
|
|
617
|
+
|
|
618
|
+
# Deploy
|
|
619
|
+
kubectl apply -f k8s/deployment.yaml
|
|
620
|
+
kubectl apply -f k8s/service.yaml
|
|
621
|
+
kubectl apply -f k8s/ingress.yaml
|
|
622
|
+
|
|
623
|
+
# Check status
|
|
624
|
+
kubectl get pods -l app=${agentName}-langserve
|
|
625
|
+
kubectl logs -f deployment/${agentName}-langserve
|
|
626
|
+
\`\`\`
|
|
627
|
+
|
|
628
|
+
`;
|
|
629
|
+
}
|
|
630
|
+
if (platforms.includes('railway')) {
|
|
631
|
+
readme += `### Railway
|
|
632
|
+
|
|
633
|
+
\`\`\`bash
|
|
634
|
+
# Install Railway CLI
|
|
635
|
+
npm install -g @railway/cli
|
|
636
|
+
|
|
637
|
+
# Login
|
|
638
|
+
railway login
|
|
639
|
+
|
|
640
|
+
# Create project
|
|
641
|
+
railway init
|
|
642
|
+
|
|
643
|
+
# Add environment variables
|
|
644
|
+
railway variables set OPENAI_API_KEY=your-key
|
|
645
|
+
railway variables set ANTHROPIC_API_KEY=your-key
|
|
646
|
+
|
|
647
|
+
# Deploy
|
|
648
|
+
railway up
|
|
649
|
+
\`\`\`
|
|
650
|
+
|
|
651
|
+
`;
|
|
652
|
+
}
|
|
653
|
+
if (platforms.includes('render')) {
|
|
654
|
+
readme += `### Render
|
|
655
|
+
|
|
656
|
+
1. Create a new Web Service on [Render](https://render.com)
|
|
657
|
+
2. Connect your Git repository
|
|
658
|
+
3. Render will auto-detect the \`render.yaml\` configuration
|
|
659
|
+
4. Add environment variables in Render dashboard:
|
|
660
|
+
- \`OPENAI_API_KEY\`
|
|
661
|
+
- \`ANTHROPIC_API_KEY\`
|
|
662
|
+
5. Deploy
|
|
663
|
+
|
|
664
|
+
`;
|
|
665
|
+
}
|
|
666
|
+
if (platforms.includes('fly')) {
|
|
667
|
+
readme += `### Fly.io
|
|
668
|
+
|
|
669
|
+
\`\`\`bash
|
|
670
|
+
# Install Fly CLI
|
|
671
|
+
curl -L https://fly.io/install.sh | sh
|
|
672
|
+
|
|
673
|
+
# Login
|
|
674
|
+
fly auth login
|
|
675
|
+
|
|
676
|
+
# Launch app
|
|
677
|
+
fly launch
|
|
678
|
+
|
|
679
|
+
# Set secrets
|
|
680
|
+
fly secrets set OPENAI_API_KEY=your-key
|
|
681
|
+
fly secrets set ANTHROPIC_API_KEY=your-key
|
|
682
|
+
|
|
683
|
+
# Deploy
|
|
684
|
+
fly deploy
|
|
685
|
+
|
|
686
|
+
# Open app
|
|
687
|
+
fly open
|
|
688
|
+
\`\`\`
|
|
689
|
+
|
|
690
|
+
`;
|
|
691
|
+
}
|
|
692
|
+
readme += `## Observability
|
|
693
|
+
|
|
694
|
+
### LangSmith Integration
|
|
695
|
+
|
|
696
|
+
Enable LangSmith tracing for debugging:
|
|
697
|
+
|
|
698
|
+
\`\`\`bash
|
|
699
|
+
export LANGCHAIN_TRACING_V2=true
|
|
700
|
+
export LANGCHAIN_API_KEY=your-langsmith-key
|
|
701
|
+
export LANGCHAIN_PROJECT=my-project
|
|
702
|
+
\`\`\`
|
|
703
|
+
|
|
704
|
+
View traces at: https://smith.langchain.com
|
|
705
|
+
|
|
706
|
+
### Health Monitoring
|
|
707
|
+
|
|
708
|
+
\`\`\`bash
|
|
709
|
+
# Check health
|
|
710
|
+
curl http://localhost:8000/health
|
|
711
|
+
|
|
712
|
+
# Get agent info
|
|
713
|
+
curl http://localhost:8000/info
|
|
714
|
+
\`\`\`
|
|
715
|
+
|
|
716
|
+
## Client Libraries
|
|
717
|
+
|
|
718
|
+
### Python
|
|
719
|
+
|
|
720
|
+
\`\`\`python
|
|
721
|
+
from langserve import RemoteRunnable
|
|
722
|
+
|
|
723
|
+
agent = RemoteRunnable("http://localhost:8000${routePath}")
|
|
724
|
+
|
|
725
|
+
# Invoke
|
|
726
|
+
result = agent.invoke("Hello!")
|
|
727
|
+
print(result)
|
|
728
|
+
|
|
729
|
+
# Stream
|
|
730
|
+
for chunk in agent.stream("Tell me a story"):
|
|
731
|
+
print(chunk, end="", flush=True)
|
|
732
|
+
|
|
733
|
+
# Batch
|
|
734
|
+
results = agent.batch(["Question 1?", "Question 2?"])
|
|
735
|
+
\`\`\`
|
|
736
|
+
|
|
737
|
+
### JavaScript/TypeScript
|
|
738
|
+
|
|
739
|
+
\`\`\`typescript
|
|
740
|
+
import { RemoteRunnable } from "@langchain/core/runnables/remote";
|
|
741
|
+
|
|
742
|
+
const agent = new RemoteRunnable({
|
|
743
|
+
url: "http://localhost:8000${routePath}"
|
|
744
|
+
});
|
|
745
|
+
|
|
746
|
+
// Invoke
|
|
747
|
+
const result = await agent.invoke("Hello!");
|
|
748
|
+
|
|
749
|
+
// Stream
|
|
750
|
+
const stream = await agent.stream("Tell me a story");
|
|
751
|
+
for await (const chunk of stream) {
|
|
752
|
+
process.stdout.write(chunk);
|
|
753
|
+
}
|
|
754
|
+
\`\`\`
|
|
755
|
+
|
|
756
|
+
## Troubleshooting
|
|
757
|
+
|
|
758
|
+
### Check Logs
|
|
759
|
+
|
|
760
|
+
\`\`\`bash
|
|
761
|
+
# Docker
|
|
762
|
+
docker logs ${agentName}-langserve
|
|
763
|
+
|
|
764
|
+
# Kubernetes
|
|
765
|
+
kubectl logs -f deployment/${agentName}-langserve
|
|
766
|
+
|
|
767
|
+
# Railway
|
|
768
|
+
railway logs
|
|
769
|
+
|
|
770
|
+
# Fly.io
|
|
771
|
+
fly logs
|
|
772
|
+
\`\`\`
|
|
773
|
+
|
|
774
|
+
### Common Issues
|
|
775
|
+
|
|
776
|
+
1. **502 Bad Gateway**: Check if the app is running and health check passes
|
|
777
|
+
2. **Timeout**: Increase timeout settings in your load balancer
|
|
778
|
+
3. **Out of Memory**: Increase container memory limits
|
|
779
|
+
4. **API Key Errors**: Verify environment variables are set correctly
|
|
780
|
+
|
|
781
|
+
## Performance Tips
|
|
782
|
+
|
|
783
|
+
1. **Enable Streaming**: Use \`/stream\` endpoint for better UX
|
|
784
|
+
2. **Batch Requests**: Use \`/batch\` for multiple inputs
|
|
785
|
+
3. **Caching**: Implement Redis for response caching
|
|
786
|
+
4. **Rate Limiting**: Add rate limiting for production
|
|
787
|
+
5. **Monitoring**: Set up health checks and metrics
|
|
788
|
+
|
|
789
|
+
## Security
|
|
790
|
+
|
|
791
|
+
1. **API Keys**: Never commit API keys to git
|
|
792
|
+
2. **CORS**: Configure CORS for production domains
|
|
793
|
+
3. **HTTPS**: Always use HTTPS in production
|
|
794
|
+
4. **Rate Limiting**: Implement rate limiting
|
|
795
|
+
5. **Authentication**: Add auth middleware for production
|
|
796
|
+
|
|
797
|
+
## Resources
|
|
798
|
+
|
|
799
|
+
- [LangServe Documentation](https://python.langchain.com/docs/langserve)
|
|
800
|
+
- [LangChain Documentation](https://python.langchain.com/)
|
|
801
|
+
- [OpenAPI Spec](/docs)
|
|
802
|
+
- [Interactive Playground](${routePath}/playground)
|
|
803
|
+
`;
|
|
804
|
+
return readme;
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
//# sourceMappingURL=langserve-generator.js.map
|