Skip to main content

Sinapsis templates for shared chatbot foundations.

Project description



Sinapsis Chatbots Base

Sinapsis templates for chatbot inputs, contextualization, and endpoint-backed completions.

🐍 Installation🚀 Features📚 Usage example📙 Documentation🔍 License

The sinapsis-chatbots-base package provides the shared chatbot foundation. It includes the base abstractions for LLM templates together with the core templates for building LLMConversationPacket inputs, adding document context from preloaded data, and sending chat requests to OpenAI-compatible HTTP endpoints.

🐍 Installation

Install using your preferred package manager. We strongly recommend using uv.

Install the base package:

uv pip install sinapsis-chatbots-base --extra-index-url https://pypi.sinapsis.tech

Or with raw pip:

pip install sinapsis-chatbots-base --extra-index-url https://pypi.sinapsis.tech

[!IMPORTANT] EndpointLLMCompletion requires the optional endpoint extra:

uv pip install sinapsis-chatbots-base[endpoint] --extra-index-url https://pypi.sinapsis.tech

all installs every optional dependency exposed by the package:

uv pip install sinapsis-chatbots-base[all] --extra-index-url https://pypi.sinapsis.tech

🚀 Features

Templates Supported

  • LLMConversationInput: Creates an LLMConversationPacket from a prompt, system prompt, and packet metadata.
  • QueryContextualizeFromFile: Builds packet contexts from files or documents already loaded into the container.
  • EndpointLLMCompletion: Sends chat requests to OpenAI-compatible endpoints such as OpenAI, Ollama, llama.cpp server, vLLM server, or compatible hosted APIs.
  • EndpointLLMStreamingCompletion: Streams chat-completion chunks from OpenAI-compatible endpoints and emits partial packet updates.
  • EndpointLLMMultiModal: Sends text + image user turns to OpenAI-compatible multimodal endpoints.

[!TIP] Use CLI command sinapsis info --all-template-names to show a list with all the available Template names installed with Sinapsis Chatbots Base.

📚 Usage example

The following agent builds an LLMConversationPacket and sends it to an OpenAI-compatible endpoint.

Config
agent:
  name: openai_api_agent

templates:
  - template_name: InputTemplate
    class_name: InputTemplate
    attributes: {}

  - template_name: LLMConversationInput
    class_name: LLMConversationInput
    template_input: InputTemplate
    attributes:
      prompt: Give three short tips for staying organized during a busy week.
      system_prompt: You are a helpful assistant.

  - template_name: EndpointLLMCompletion
    class_name: EndpointLLMCompletion
    template_input: LLMConversationInput
    attributes:
      init_args:
        base_url: "https://api.openai.com/v1"
        llm_model_name: "gpt-4o-mini"
      completion_args:
        max_tokens: 2048

📙 Documentation

Documentation for this and other sinapsis packages is available on the sinapsis website

Tutorials for different projects within sinapsis are available at sinapsis tutorials page

🔍 License

This project is licensed under the AGPLv3 license, which encourages open collaboration and sharing. For more details, please refer to the LICENSE file.

For commercial use, please refer to our official Sinapsis website for information on obtaining a commercial license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sinapsis_chatbots_base-0.2.1.tar.gz (34.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sinapsis_chatbots_base-0.2.1-py3-none-any.whl (42.2 kB view details)

Uploaded Python 3

File details

Details for the file sinapsis_chatbots_base-0.2.1.tar.gz.

File metadata

File hashes

Hashes for sinapsis_chatbots_base-0.2.1.tar.gz
Algorithm Hash digest
SHA256 aa00dcfa8c611873817ab5de9aefa6ad6fcb63e3223aaaa088f93bba44506414
MD5 c01c3c254790f54fcf04ca314a6591eb
BLAKE2b-256 90b592c494c13348d8df85351e4496230fe4df48e67140e8cb7e55173d17f43d

See more details on using hashes here.

File details

Details for the file sinapsis_chatbots_base-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for sinapsis_chatbots_base-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 170d5451b61000f6d5fc71a5fe1a10ef5ae7cd6b19a46ab7463e157574a898d4
MD5 f215c618da688744872ffdf2a093f25d
BLAKE2b-256 d2e4e2aabda68de62513c874d50277dbe1a926246b2c827347c218c31c0f8e54

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page