Skip to content

Response Suggestion

response_style accepts professional (default), friendly, empathetic, formal, apologetic, or solution_focused. Each style appears in the response schema's allowed tone values; unsupported styles raise ValueError.

openaivec.task.customer_support.response_suggestion

Customer response-suggestion task definition.

Classes

ResponseSuggestion

Bases: BaseModel

Response suggestion output.

Functions:

response_suggestion

response_suggestion(
    response_style: str = "professional",
    company_name: str = "our company",
    business_context: str = "general customer support",
) -> PreparedTask[ResponseSuggestion]

Create a response suggestion task.

Parameters:

Name Type Description Default
response_style str

One of the supported response tones.

'professional'
company_name str

Company name used in the prompt.

'our company'
business_context str

Customer-support context.

'general customer support'

Returns:

Type Description
PreparedTask[ResponseSuggestion]

PreparedTask[ResponseSuggestion]: Response-suggestion task.

Raises:

Type Description
ValueError

If the response style is not a supported tone.

Source code in src/openaivec/task/customer_support/response_suggestion.py
def response_suggestion(
    response_style: str = "professional",
    company_name: str = "our company",
    business_context: str = "general customer support",
) -> PreparedTask[ResponseSuggestion]:
    """Create a response suggestion task.

    Args:
        response_style (str): One of the supported response tones.
        company_name (str): Company name used in the prompt.
        business_context (str): Customer-support context.

    Returns:
        PreparedTask[ResponseSuggestion]: Response-suggestion task.

    Raises:
        ValueError: If the response style is not a supported tone.
    """
    if response_style not in _STYLE_GUIDANCE:
        raise ValueError(f"Unsupported response_style: {response_style}")
    return PreparedTask(
        instructions=_build_instructions(
            response_style=response_style,
            company_name=company_name,
            business_context=business_context,
        ),
        response_format=ResponseSuggestion,
    )