Skip to content

Commit f4e8229

Browse files
Copilothotlong
andauthored
test: add 42 tests for chatbot features and export Agent type from spec
- Add comprehensive test suite for chatWithTools loop, data tools, agent runtime, agent routes - Export Agent type from @objectstack/spec index for use in service-ai - Update CHANGELOG.md with data chatbot feature entry Agent-Logs-Url: https://github.com/objectstack-ai/spec/sessions/10c08b4e-c31c-42cd-a9d4-27917289db5b Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 71909ed commit f4e8229

3 files changed

Lines changed: 725 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,29 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
## [Unreleased]
99

1010
### Added
11+
- **`@objectstack/service-ai` — Data Chatbot: Tool Call Loop & Agent Runtime** — Implements
12+
an Airtable Copilot-style data conversation Chatbot with full-stack support:
13+
- `AIService.chatWithTools()` — automatic multi-round LLM ↔ tool call loop with
14+
`maxIterations` safety limit, parallel tool execution, and forced final response
15+
- `AIResult.toolCalls` — new field on the AI result contract so adapters can return
16+
tool call requests from the LLM
17+
- `ChatWithToolsOptions` — new contract interface extending `AIRequestOptions`
18+
- 5 built-in data tools: `list_objects`, `describe_object`, `query_records`,
19+
`get_record`, `aggregate_data` — with parameter schemas, limit capping (max 200),
20+
and error handling
21+
- `registerDataTools(registry, context)` — factory to register all data tools
22+
against `IDataEngine` + `IMetadataService`
23+
- `AgentRuntime` — loads agent metadata, builds system prompts from instructions +
24+
UI context (`objectName`, `recordId`, `viewName`), resolves agent tool references
25+
against the `ToolRegistry`
26+
- `buildAgentRoutes()` — new `POST /api/v1/ai/agents/:agentName/chat` route with
27+
agent lookup, active-check, context injection, and `chatWithTools` integration
28+
- `DATA_CHAT_AGENT` — built-in `data_chat` agent spec with role, instructions,
29+
guardrails, planning config, and tool declarations
30+
- `AIServicePlugin` auto-registers data tools and `data_chat` agent when
31+
`IDataEngine` + `IMetadataService` are available in the kernel
32+
- 42 new test cases covering tool call loop, data tools, agent runtime, agent
33+
routes, and agent spec validation
1134
- **`@objectstack/service-ai` — ObjectQL-backed persistent ConversationService** — New
1235
`ObjectQLConversationService` implements `IAIConversationService` using `IDataEngine`
1336
for durable conversation and message storage across service restarts:

0 commit comments

Comments
 (0)