1
0
mirror of https://github.com/go-micro/go-micro.git synced 2026-05-06 19:21:46 +02:00
Commit Graph

8 Commits

Author SHA1 Message Date
Asim Aslam 759ad1de50 x 2026-02-12 10:59:51 +00:00
Asim Aslam 92b9f84d79 x 2026-02-12 10:55:13 +00:00
Asim Aslam 3a605c461d x 2026-02-12 10:45:13 +00:00
Asim Aslam de615e0573 x 2026-02-12 10:34:53 +00:00
Asim Aslam 9d9968d66b scopes 2026-02-12 10:33:15 +00:00
Asim Aslam 33e828acdd x 2026-02-12 10:11:58 +00:00
Copilot 06608d354e Add Anthropic model support to the agent (#2855)
* Initial plan

* Add MCP Playground page to web UI with tool discovery and calling

- Add playground.html template with chat-style agent prompt interface
- Add /playground route handler in server
- Add /api/mcp/tools endpoint to list available MCP tools
- Add /api/mcp/call endpoint to invoke MCP tools via RPC
- Add Playground link to sidebar navigation
- Playground auto-discovers services from registry and renders them as
  callable tools with input forms and activity logging

Co-authored-by: asim <17530+asim@users.noreply.github.com>

* Add playground.html template and fix .gitignore micro pattern

Fix .gitignore pattern 'micro' -> '/micro' to only ignore root-level
binary, not paths containing 'micro' as a component.

Co-authored-by: asim <17530+asim@users.noreply.github.com>

* Address code review: use crypto/rand for trace IDs, fix var redecl, remove dup comment

Co-authored-by: asim <17530+asim@users.noreply.github.com>

* Rename Playground to Agent, fix styling, add LLM-powered prompt

- Rename /playground to /agent, move Agent link to top of sidebar menu
- Fix template styling: use existing form/input/button CSS from styles.css
  instead of inline styles and form-plain class
- Add /api/agent/settings GET/POST endpoints for model API key, model
  name, and base URL configuration (stored in server store)
- Add /api/agent/prompt POST endpoint that sends user prompt to
  OpenAI-compatible LLM API with tool definitions from registry,
  executes any tool calls via RPC, and returns results with a
  follow-up LLM summary
- Show available tools in a table using existing table styles
- Prompt section is placed above settings for primary workflow

Co-authored-by: asim <17530+asim@users.noreply.github.com>

* Address code review: handle unmarshal errors, extract system prompt, improve param descriptions

Co-authored-by: asim <17530+asim@users.noreply.github.com>

* Add Anthropic model support to the agent

Support both OpenAI and Anthropic APIs in the agent prompt handler:
- Add provider selector (OpenAI/Anthropic) to settings UI and backend
- Auto-detect provider from base URL when not explicitly set
- Anthropic: use /v1/messages endpoint, x-api-key header, input_schema
  format for tools, content blocks for responses, tool_use/tool_result
  message format for follow-ups
- OpenAI: unchanged /v1/chat/completions with Bearer auth
- Default models: gpt-4o (OpenAI), claude-sonnet-4-20250514 (Anthropic)
- Provider-specific defaults for base URLs

Co-authored-by: asim <17530+asim@users.noreply.github.com>

* Remove duplicate Anthropic follow-up message construction

Co-authored-by: asim <17530+asim@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: asim <17530+asim@users.noreply.github.com>
2026-02-12 09:32:27 +00:00
asim 1dde737b64 move micro cli and protoc-gen-micro to cmd/ 2025-10-14 11:13:35 +01:00