Skip to content

mirascope.core.cohere.dynamic_config

This module defines the function return type for functions as LLM calls.

CohereDynamicConfig module-attribute

CohereDynamicConfig = BaseDynamicConfig[
    ChatMessage | BaseMessageParam, CohereCallParams
]

The function return type for functions wrapped with the cohere_call decorator.

Example:

from mirascope.core import prompt_template
from mirascope.core.cohere import CohereDynamicConfig, cohere_call


@cohere_call("command-r-plus")
@prompt_template("Recommend a {capitalized_genre} book")
def recommend_book(genre: str) -> CohereDynamicConfig:
    return {"computed_fields": {"capitalized_genre": genre.capitalize()}}