Skip to main content
agentscope-extensions-chat-completions-web exposes an AgentScope Agent behind an OpenAI Chat Completions-compatible API, so OpenAI SDKs, LangChain, LlamaIndex, ChatBox, etc. can connect as if they were talking to OpenAI.

When to use

  • You want to expose your Agent as a “standard LLM” without modifying clients.
  • You need streaming with tool-call events that match the OpenAI SSE format.

Add the dependency

Note: this module ships only the framework-agnostic core adapter — wire HTTP/SSE through the matching Spring Boot Starter (recommended) or your own controller.

Core adapter

The adapter converts AgentScope’s Event stream (including REASONING and TOOL_RESULT) into OpenAI-compatible ChatCompletionsChunk objects:
  • Text deltas → delta.content
  • Tool calls → delta.tool_calls[]
  • Stream end → a chunk with finish_reason

Expose as SSE in Spring Boot

Easiest is the starter — it registers the controller. To do it manually:

Model routing

OpenAI clients send a model field; route at the controller layer:

Pairs well with

  • AG-UI for fine-grained UI rendering with event semantics.
  • Chat Completions Web for plain LLM-style integrations focused on OpenAI compatibility.