ReqLLM.Providers.Alibaba.Shared (ReqLLM v1.12.0)

View Source

Shared logic for Alibaba Cloud Bailian (DashScope) providers.

Contains the DashScope-specific provider schema, option translation, and body construction used by both the international (ReqLLM.Providers.Alibaba) and China/Beijing (ReqLLM.Providers.AlibabaCN) providers.

Summary

Functions

Builds a streaming request with validated and translated options.

Builds the request body map with DashScope-specific parameters merged in.

Returns the list of DashScope-specific option keys.

Encodes the request body using the DashScope body builder.

Overrides the default request preparation for :object operations to inject the appropriate response_format for DashScope's native structured output (JSON output).

Returns the DashScope-specific provider schema.

Returns the provider option keys that must be registered on requests.

Translates provider-specific options into DashScope parameters.

Functions

attach_stream(provider_mod, model, context, opts, finch_name)

Builds a streaming request with validated and translated options.

build_body(request)

Builds the request body map with DashScope-specific parameters merged in.

dashscope_keys()

Returns the list of DashScope-specific option keys.

encode_body(request)

Encodes the request body using the DashScope body builder.

prepare_request(provider_mod, operation, model_spec, prompt, opts)

Overrides the default request preparation for :object operations to inject the appropriate response_format for DashScope's native structured output (JSON output).

provider_schema()

Returns the DashScope-specific provider schema.

supported_provider_options()

Returns the provider option keys that must be registered on requests.

translate_options(operation, model, opts)

Translates provider-specific options into DashScope parameters.

Extracts DashScope-specific keys from the options and collects them into a :dashscope_parameters keyword, leaving standard OpenAI options untouched.