Skip to content

Add alternate lookup keys for registered clients and factories#280

Merged
kzu merged 1 commit into
mainfrom
dev/alternate-lookup-keys
May 15, 2026
Merged

Add alternate lookup keys for registered clients and factories#280
kzu merged 1 commit into
mainfrom
dev/alternate-lookup-keys

Conversation

@kzu
Copy link
Copy Markdown
Member

@kzu kzu commented May 15, 2026

Registers the following aliases for every keyed IClientFactory and IChatClient (first-wins via TryAdd), in priority order:

  1. Configured id attribute from the section
  2. Section path, lowercase invariant (e.g. ai:clients:grok for ai:clients:Grok)
  3. Section path with : replaced by . (e.g. ai.clients.Grok)
  4. Section path with : replaced by ., lowercase (e.g. ai.clients.grok)
  5. Last path segment (e.g. Grok)
  6. Last path segment, lowercase (e.g. grok)

Alternate keys make client resolution case-insensitive and support both colon and dot-separated paths, improving developer ergonomics when looking up services by key.

Registers the following aliases for every keyed IClientFactory and IChatClient
(first-wins via TryAdd), in priority order:

1. Configured `id` attribute from the section
2. Section path, lowercase invariant (e.g. `ai:clients:grok` for `ai:clients:Grok`)
3. Section path with `:` replaced by `.` (e.g. `ai.clients.Grok`)
4. Section path with `:` replaced by `.`, lowercase (e.g. `ai.clients.grok`)
5. Last path segment (e.g. `Grok`)
6. Last path segment, lowercase (e.g. `grok`)

Alternate keys make client resolution case-insensitive and support both colon and
dot-separated paths, improving developer ergonomics when looking up services by key.
@kzu kzu enabled auto-merge (rebase) May 15, 2026 20:31
@kzu
Copy link
Copy Markdown
Member Author

kzu commented May 15, 2026

44 passed 44 passed 10 skipped

🧪 Details on Ubuntu 24.04.4 LTS

from retest v1.1.0 on .NET 10.0.8 with 💜 by @devlooped

@kzu kzu merged commit 382c087 into main May 15, 2026
4 checks passed
@kzu kzu deleted the dev/alternate-lookup-keys branch May 15, 2026 20:32
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.

1 participant