Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ai-chat-chain

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ai-chat-chain

maintain chat conversation state

  • 0.2.4
  • PyPI
  • Socket score

Maintainers
1

simple chat context manager

  • override everything
  • works with any model
  • works with any prompt recovery system (simple history, embedding search, whatever)
  • chains functions well
  • uses ai-functions and executes them

install

poetry add or pip install this repo, for now

example:

from ai_chat import AiConfig

# only supports openai for now, todo: add other models
from ai_chat.openai import OpenaiChat
from ai_chat.store import SupabaseStore
from ai_functions import AIFunctions

# supports SqliteStore() as well as MemoryStore() for storing the chain of prompts

store = SupabaseStore()
conf = AiConfig(id="persona-id-1", system="You are a silly friend.")
session = OpenaiChat(store=store, ai=conf, thread_id="session-1")

def search_google():
    ...

def get_calendar():
    ...

def add_calendar():
    ...

session.functions = AIFunctions([search_google, get_calendar, add_calendar])

print(session.chat("hello").content)

# this contains the hello, and the reply in the context
print(session.chat("cool").content)

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc