MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / contextWithRequestedModelAlias

Function contextWithRequestedModelAlias

sdk/cliproxy/auth/conductor.go:2890–2902  ·  view source on GitHub ↗
(ctx context.Context, opts cliproxyexecutor.Options, fallback string)

Source from the content-addressed store, hash-verified

2888}
2889
2890func contextWithRequestedModelAlias(ctx context.Context, opts cliproxyexecutor.Options, fallback string) context.Context {
2891 alias := requestedModelAliasFromOptions(opts, fallback)
2892 ctx = coreusage.WithRequestedModelAlias(ctx, alias)
2893 effort := reasoningEffortFromOptions(opts)
2894 if effort != "" {
2895 ctx = coreusage.WithReasoningEffort(ctx, effort)
2896 }
2897 serviceTier := serviceTierFromOptions(opts)
2898 if serviceTier != "" {
2899 ctx = coreusage.WithServiceTier(ctx, serviceTier)
2900 }
2901 return ctx
2902}
2903
2904func requestedModelAliasFromOptions(opts cliproxyexecutor.Options, fallback string) string {
2905 fallback = strings.TrimSpace(fallback)

Calls 3

serviceTierFromOptionsFunction · 0.85