Docs /Templates/ sinapsis-chatbots-base

EndpointLLMStreamingCompletion

sinapsis-chatbots-baseChatbotschatbotscontextlarge_language_modelstext_completion

Python template · sinapsis_chatbots_base.templates.endpoint_llm_streaming_completion

Overview

Streaming template for OpenAI-compatible chat completion endpoints.

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

Endpoint connection configuration.

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
completion_args

Generation and structured-output arguments.

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
reasoning_end_tag
str | None
Optional
Default: "</think>"
reasoning_start_tag
str | None
Optional
Default: "<think>"

Configuration example

Example from the Python docstring:

yaml
agent:
  name: my_test_agent
templates:
  - template_name: InputTemplate
    class_name: InputTemplate
    attributes: {}
  - template_name: EndpointLLMStreamingCompletion
    class_name: EndpointLLMStreamingCompletion
    template_input: InputTemplate
    attributes:
      init_args:
        base_url: "http://127.0.0.1:8000/v1"
        llm_model_name: "Qwen/Qwen3-4B"
      completion_args:
        max_tokens: 1024
        temperature: 0.7
Show schema-based configuration skeleton
yaml
templates:
  - template_name: "EndpointLLMStreamingCompletion"
    class_name: "EndpointLLMStreamingCompletion"
    attributes:
      init_args:
        api_key: null
        timeout: 120
        base_url: "<required>"
        llm_model_name: null
        default_headers: null
      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
      reasoning_end_tag: "</think>"
      reasoning_start_tag: "<think>"

Inheritance

Immediate parent: sinapsis_chatbots_base.templates.llm_streaming_base.LLMStreamingTemplateBase

Environment variables

Environment definitions belong to their canonical Python modules.

No directly related environment variables listed.