Skip to content

feat: code-first agents (base44.agents.create) - #205

Closed
yardend-wix wants to merge 31 commits into
mainfrom
feature/dynamic-agents
Closed

feat: code-first agents (base44.agents.create)#205
yardend-wix wants to merge 31 commits into
mainfrom
feature/dynamic-agents

Conversation

@yardend-wix

@yardend-wix yardend-wix commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

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; model is 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:
    • a backend function → base44.functions.asTool(name, { description })
    • another agent → agent.asTool({ name, description }) (sub-agents)
    • an entity → base44.entities.<Name>.asTool({ operations }) (read-only by default; opt into create/update/delete)

The existing base44.agents conversation methods and InvokeLLM are untouched.

Built on the Base44 AI Gateway: base44-dev/apper#12366

@claude

claude Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Claude encountered an error —— View job


I'll analyze this and get back to you.

@github-actions

github-actions Bot commented Jun 23, 2026

Copy link
Copy Markdown

🚀 Package Preview Available!


Install this PR's preview build with npm:

npm i @base44-preview/sdk@0.8.34-pr.205.d800012

Prefer not to change any import paths? Install using npm alias so your code still imports @base44/sdk:

npm i "@base44/sdk@npm:@base44-preview/sdk@0.8.34-pr.205.d800012"

Or add it to your package.json dependencies:

{
  "dependencies": {
    "@base44/sdk": "npm:@base44-preview/sdk@0.8.34-pr.205.d800012"
  }
}

Preview published to npm registry — try new features instantly!

yardend-wix and others added 9 commits June 23, 2026 20:38
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>
yardend-wix and others added 6 commits June 24, 2026 11:21
…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>
yardend-wix and others added 2 commits June 24, 2026 17:10
…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>
@yardend-wix yardend-wix reopened this Jun 24, 2026
@yardend-wix yardend-wix changed the title feat: Dynamic Agents SDK (base44.dynamicAgents) feat: code-first agents (base44.agents.create) Jun 24, 2026
@claude

claude Bot commented Jun 24, 2026

Copy link
Copy Markdown
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>
@claude

claude Bot commented Jun 25, 2026

Copy link
Copy Markdown
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>
@claude

claude Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Claude encountered an error —— View job


I'll analyze this and get back to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant