Docs /Templates/ sinapsis-chatbots-base

EndpointLLMCompletionWithMCP

sinapsis-chatbots-baseChatbotschatbotscontextlarge_language_modelstext_completion

Python template · sinapsis_chatbots_base.templates.endpoint_llm_completion_mcp

Overview

Template for OpenAI-compatible endpoint chat completion with MCP tool support.

Capabilities

Capabilities: not set

Installation

Install the published package using pip or uv.

Terminalbash
pip install sinapsis-chatbots-base==1.0.0
uv pip install sinapsis-chatbots-base==1.0.0
uv add sinapsis-chatbots-base==1.0.0

Configuration

Effective fields from the inspector schema, including nested Pydantic model fields.

metadata
sinapsis_core.template_base.base_models.TemplateMetadata | None
Optional
Default: null
init_argsRequired
EndpointLLMInitArgs
Required
Default: null
api_key

Optional API key override. Falls back to `LLM_API_KEY`.

str | None
Optional
Default: null
timeout

Request timeout in seconds.

float
Optional
Default: 120
base_urlRequired

Base URL for the OpenAI-compatible endpoint.

str
Required
Default: null
llm_model_name

Explicit model name. When `None`, the endpoint default is used.

str | None
Optional
Default: null
default_headers

Additional headers to include in requests.

dict[str, str]
Optional
Default: null
tool_choice

Tool-choice directive for the endpoint request.

str | dict[str, typing.Any] | None
Optional
Default: "auto"
completion_args
EndpointLLMCompletionArgs
Optional
Default: null
seed

Optional seed for reproducibility.

int | None
Optional
Default: null
stop

Stop sequences.

str | list[str] | None
Optional
Default: null
top_k
int | None
Optional
Default: null
top_p
float | None
Optional
Default: null
max_tokens

Maximum number of output tokens.

int
Optional
Default: 4096
temperature
float | None
Optional
Default: null
additional_args

Extra provider-specific request arguments.

dict[str, typing.Any]
Optional
Default: null
response_format
LLMResponseFormat
Optional
Default: null
type_

Output mode. Aliased to `type`.

typing.Literal['text', 'json_object']
Optional
Default: "text"
schema_

Optional schema used for structured JSON output. Aliased to `schema`.

SchemaDefinition
Optional
Default: null
required

Required root property names.

list[str]
Optional
Default: null
properties

Root schema properties.

dict[str, str | sinapsis_chatbots_base.helpers.schemas.PropertyDefinition]
Optional
Default: null
additional_properties

Whether extra root-level fields are allowed.

bool | None
Optional
Default: null
presence_penalty

Presence penalty.

float | None
Optional
Default: null
frequency_penalty

Frequency penalty.

float | None
Optional
Default: null
cleanup_response
bool
Optional
Default: true
max_tool_retries

Maximum number of consecutive failed tool rounds before stopping.

int
Optional
Default: 3
reasoning_end_tag
str | None
Optional
Default: "</think>"
add_tool_to_prompt

Whether tool descriptions should be appended to the system prompt.

bool
Optional
Default: true
reasoning_start_tag
str | None
Optional
Default: "<think>"
send_tools_in_payload

Whether tool definitions should be sent through the endpoint payload.

bool
Optional
Default: true

Configuration example

Example from the Python docstring:

yaml
agent:
  name: time_mcp_client
templates:
  - template_name: InputTemplate
    class_name: InputTemplate
    attributes: {}
  - template_name: EndpointLLMCompletionWithMCP
    class_name: EndpointLLMCompletionWithMCP
    template_input: InputTemplate
    attributes:
      init_args:
        base_url: "http://localhost:8000/v1"
        llm_model_name: "Qwen/Qwen3-8B"
      completion_args:
        max_tokens: 2048
        temperature: 0.2
Show schema-based configuration skeleton
yaml
templates:
  - template_name: "EndpointLLMCompletionWithMCP"
    class_name: "EndpointLLMCompletionWithMCP"
    attributes:
      init_args:
        api_key: null
        timeout: 120
        base_url: "<required>"
        llm_model_name: null
        default_headers: null
      tool_choice: "auto"
      completion_args:
        seed: null
        stop: null
        top_k: null
        top_p: null
        max_tokens: 4096
        temperature: null
        additional_args: null
        response_format:
          type_: "text"
          schema_:
            required: null
            properties: null
            additional_properties: null
        presence_penalty: null
        frequency_penalty: null
      cleanup_response: true
      max_tool_retries: 3
      reasoning_end_tag: "</think>"
      add_tool_to_prompt: true
      reasoning_start_tag: "<think>"
      send_tools_in_payload: true

Inheritance

Immediate parent: sinapsis_chatbots_base.templates.endpoint_llm_completion.EndpointLLMCompletion

Environment variables

Environment definitions belong to their canonical Python modules.

No directly related environment variables listed.