Skip to content

refactor(model): move DashScope/Ollama model provider from core to extensions module#1947

Merged
chickenlj merged 4 commits into
agentscope-ai:mainfrom
jujn:refactor/move-dashscope-and-ollama-to-extensions
Jun 29, 2026
Merged

refactor(model): move DashScope/Ollama model provider from core to extensions module#1947
chickenlj merged 4 commits into
agentscope-ai:mainfrom
jujn:refactor/move-dashscope-and-ollama-to-extensions

Conversation

@jujn

@jujn jujn commented Jun 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR continues the model adapter modularization work by moving DashScope and Ollama model implementations out of agentscope-core into dedicated agentscope-extensions-model-* modules. It also moves the former core E2E test suite into a new model-extension E2E test module, and adds .editorconfig to enforce UTF-8 without BOM.

Major Changes

DashScope model extension

  • Added agentscope-extensions-model-dashscope.
  • Moved DashScope chat model, HTTP client, encryption utilities, endpoint enum, credential, formatter, DTOs, and DashScopeMultiModalTool from core into the new extension module.
  • Added DashScopeModelProvider SPI registration.
  • Supports:
    • dashscope:.+
    • short Qwen model ids matching qwen.+
  • Removed DashScope built-in factory logic and dashscope-sdk-java dependency from core.
  • Updated Spring Boot starter, scheduler, studio telemetry, examples, and RAG simple imports/dependencies.
  • Added baseUrl support to DashScope Spring Boot properties and related tests.

Ollama model extension

  • Added agentscope-extensions-model-ollama.
  • Moved Ollama chat model, HTTP client, credential, formatter, DTOs, and options from core into the new extension module.
  • Added OllamaModelProvider SPI registration.
  • Supports ollama:.+ via SPI.
  • Removed Ollama built-in factory logic from core.
  • Updated RAG simple embedding code/tests to reuse the Ollama extension module.

Core cleanup

  • Removed remaining built-in model factory infrastructure from ModelRegistry.
  • ModelRegistry now resolves named models, user-registered factories, and SPI providers only.
  • Updated ModelRegistryTest and credential tests accordingly.
  • Removed stale core E2E compiler exclusion from agentscope-core/pom.xml.
  • Kept shared model context window metadata in core.

E2E test migration

  • Added agentscope-extensions-model-e2e-tests.
  • Moved the former io.agentscope.core.e2e test suite into the new model-extension E2E module.
  • Moved DashScope multimodal tool E2E coverage under the DashScope extension package.
  • Copied required E2E resources into the new module.
  • E2E tests remain disabled by default and require ENABLE_E2E_TESTS=true plus provider API keys.

Packaging and downstream updates

  • Added DashScope/Ollama modules to the model extension aggregator, distribution BOM, and all-in-one artifact where appropriate.
  • Added the E2E test module only to the model extension aggregator, not to distribution artifacts.
  • Updated documentation examples and affected example modules to use extension packages.
  • Added .editorconfig with UTF-8 settings to avoid UTF-8 BOM regressions.

Provider consistency

  • Updated OpenAI, Gemini, Anthropic, DashScope, and Ollama model providers to validate supports(modelId) in create. Standardized provider matching to use Pattern.matcher(modelId).matches().

@jujn jujn requested a review from a team June 27, 2026 12:29
@chickenlj chickenlj merged commit 235ffb8 into agentscope-ai:main Jun 29, 2026
5 of 6 checks passed
@jujn jujn deleted the refactor/move-dashscope-and-ollama-to-extensions branch June 29, 2026 05:07
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.

2 participants