Skip to content

feat(connectors): expose config field prompts in the config-map endpoint - #223

Merged
cardosofede merged 1 commit into
mainfrom
feat/improve_config_map_response
Sep 1, 2026
Merged

cardosofede merged 1 commit into
mainfrom
feat/improve_config_map_response

Conversation

@cardosofede

Copy link
Copy Markdown
Contributor

What

GET /connectors/{connector_name}/config-map now returns the human readable prompt that Hummingbot already defines for each credential field, alongside the existing type / required / allowed_values.

Before, clients had to invent their own labels for connector credential forms.

How

Prompts live in each field's json_schema_extra, either as a plain string (e.g. binance_perpetual, pacifica_perpetual) or as a callable taking the config map (e.g. binance uses lambdas). _resolve_field_prompt handles both and simply omits the key if resolving one raises, so a misbehaving connector can't break the endpoint.

Example

GET /connectors/pacifica_perpetual/config-map

{
  "pacifica_perpetual_agent_wallet_public_key": {
    "type": "SecretStr",
    "required": true,
    "prompt": "Enter your Pacifica Perpetual Agent Wallet Public Key"
  },
  "pacifica_perpetual_api_config_key": {
    "type": "SecretStr",
    "required": false,
    "prompt": "Enter your Pacifica Perpetual API Config Key (optional)"
  }
}

Testing

Ran the config map against pacifica_perpetual, binance (callable prompts), kraken and hyperliquid_perpetual (Literal field, keeps allowed_values next to the prompt) — all resolve correctly.

Also stripped pre-existing trailing whitespace in routers/connectors.py (the flake8 pre-commit hook fails on the file otherwise) and documented prompt + allowed_values in the endpoint docstring so they show in the OpenAPI schema.

🤖 Generated with Claude Code

https://claude.ai/code/session_01HbBYBEcgRVGXiZiq7kLDBv

The Hummingbot config maps carry a human readable prompt per field, but
/connectors/{connector}/config-map only returned the type and whether the
field was required, so clients had to invent their own labels.

Prompts live in json_schema_extra either as a plain string or as a callable
taking the config map, so callables are resolved before being returned and a
failing one just omits the key instead of breaking the endpoint.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HbBYBEcgRVGXiZiq7kLDBv
@greptile-apps

greptile-apps Bot commented Aug 31, 2026

Copy link
Copy Markdown

Greptile Summary

The PR extends connector configuration-map responses with human-readable prompts resolved from Hummingbot field metadata, while preserving existing type, required, and allowed-value information.

  • Supports both static string prompts and callable prompts.
  • Omits prompts whose callable resolution fails, preventing one malformed prompt from failing the endpoint.
  • Updates endpoint documentation to describe prompt and allowed_values.

Confidence Score: 5/5

The PR appears safe to merge with no concrete blocking or independently actionable non-blocking issues identified.

The prompt metadata is added conditionally, callable failures are isolated, and existing configuration-map fields remain unchanged.

Important Files Changed

Filename Overview
services/unified_connector_service.py Adds guarded prompt extraction and callable resolution to connector configuration-map serialization; no actionable defect was established.
routers/connectors.py Documents the expanded response metadata and performs whitespace-only cleanup elsewhere.

Reviews (1): Last reviewed commit: "feat(connectors): expose config field pr..." | Re-trigger Greptile

@david-hummingbot david-hummingbot self-assigned this Aug 31, 2026
@rapcmia rapcmia moved this to Under Review in Pull Request Board Sep 1, 2026
@cardosofede
cardosofede merged commit acc1b44 into main Sep 1, 2026
1 check passed
@rapcmia rapcmia moved this from Under Review to Hummingbot-API in Pull Request Board Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Hummingbot-API

Development

Successfully merging this pull request may close these issues.

3 participants