MCPcopy Create free account
hub / github.com/dashscope/dashscope-sdk-java / on_config

Function on_config

docs/hooks.py:6–15  ·  view source on GitHub ↗
(config, **kwargs)

Source from the content-addressed store, hash-verified

4
5
6def on_config(config, **kwargs):
7 pom = Path(config.config_file_path).parent / "pom.xml"
8 text = pom.read_text(encoding="utf-8")
9 # The <version> right after the project artifactId is the SDK version (parent pom
10 # coordinates come first, so anchor on the artifactId to skip them).
11 m = re.search(
12 r"<artifactId>dashscope-sdk-java</artifactId>\s*<version>([^<]+)</version>", text
13 )
14 config.extra["sdk_version"] = m.group(1) if m else "unknown"
15 return config

Callers

nothing calls this directly

Calls 1

searchMethod · 0.80

Tested by

no test coverage detected