feat: code-first agents (base44.agents.create) - #205
Closed
yardend-wix wants to merge 31 commits into
Closed
Conversation
Implement tool() identity factory as a public API seam and serializeTools() to map tools to OpenAI function-tool format. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…th impl Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…en thunk type Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…tly (drop fragile data-unwrap) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
🚀 Package Preview Available!Install this PR's preview build with npm: npm i @base44-preview/sdk@0.8.34-pr.205.d800012Prefer not to change any import paths? Install using npm alias so your code still imports npm i "@base44/sdk@npm:@base44-preview/sdk@0.8.34-pr.205.d800012"Or add it to your {
"dependencies": {
"@base44/sdk": "npm:@base44-preview/sdk@0.8.34-pr.205.d800012"
}
}
Preview published to npm registry — try new features instantly! |
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…e dynamicAgents Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…; single base44.agents namespace Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Agent.run and Agent.asTool: added full @param/@returns/@example peer-depth JSDoc - AgentConfig: expanded interface-level block + all seven fields documented - RunOptions: added @example with AbortController pattern - tool() factory: added @param/@returns/@example - No internal planning language found or removed (grep clean) - Runtime behavior, signatures, and tests unchanged Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…asts Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…onse behavior identical
…nts/ Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…confined to the adapter Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…age[] history mapping Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ions vocabulary Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…larify loop internals - RunUsage: rename promptTokens/completionTokens -> inputTokens/outputTokens - RunResult: add totalUsage (summed across all model calls); usage is the final call - Step: carry per-call usage so totalUsage is auditable - openai-compatible adapter maps prompt_tokens/completion_tokens/base44_credits accordingly - readability: clearer names (modelResult, matchedTool, totalUsage, sumUsage) and multi-line returns in loop.ts / openai-compatible.ts Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ault) - read_/create_/update_/delete_<Entity> tools built from operations allow-list - read uses a filter (query/sort/limit/skip/fields); create/update/delete wired to the entity handler - read-only default; writes opt-in via operations - params are deferred-schema (open object for create/update) — schema-derived params are a follow-up - drop internal-discussion/roadmap notes from agents-module comments Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
- Tool/JSONSchema defined in agents.types (the owner); entities/functions import them directly, matching the repo's cross-module type convention - usage aggregation across steps (usage + totalUsage + per-step) - typed FinishReason for RunResult; provider/gateway seam cleanups Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
Transport is now a wire-agnostic authenticated JSON POST; the provider supplies the path (/chat/completions). Lets future Anthropic/Gemini providers reuse the same transport with their own paths, no changes here. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a code-first way to build AI agents in the SDK, under
base44.agents.base44.agents.create({ model, system, tools })— define an agent in code and run it with.run({ prompt }). The SDK runs the tool-calling loop against the Base44 AI Gateway;modelis just a string (e.g."claude_sonnet_4_6"), and the connection is handled by the client.tool({ description, parameters, execute })— define a tool the agent can call..asTool()— turn SDK resources into tools an agent can use:base44.functions.asTool(name, { description })agent.asTool({ name, description })(sub-agents)base44.entities.<Name>.asTool({ operations })(read-only by default; opt into create/update/delete)The existing
base44.agentsconversation methods andInvokeLLMare untouched.Built on the Base44 AI Gateway: base44-dev/apper#12366