patterns-ai-core / langchainrb

Build LLM-powered applications in Ruby

Home Page:https://rubydoc.info/gems/langchainrb

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Conceal `Langchain::Thread` away when creating or interacting with `Langchain::Assistant`.

andreibondarev opened this issue · comments

Description

When user is instantiating Langchain::Assistant, they're explicitly passing thread: Langchain::Thread.new in. This detail can be concealed away, it's an implementation detail.

Tasks

  • Make thread: nil optional in the initializer.
  • Create a new thread if no thread was passed in:
@thread = thread || Langchain::Thread.new