Skip to content

Conversation

gadenbuie
Copy link
Contributor

@gadenbuie gadenbuie commented Aug 8, 2025

Fixes #58

Python

querychat.init() now accepts a client argument, replacing the previous create_chat_callback argument.

The client can be:

  • a chatlas.Chat object,
  • a function that returns a chatlas.Chat object,
  • or a provider-model string, e.g. "openai/gpt-4.1", to be passed to chatlas.ChatAuto().

If client is not provided, querychat will use the QUERYCHAT_CLIENT environment variable, which should be a provider-model string. If the envvar is not set, querychat uses OpenAI with the default model from chatlas.ChatOpenAI().

R

querychat_init() now accepts a client, replacing the previous create_chat_func argument.

The client can be:

  • an ellmer::Chat object,
  • a function that returns an ellmer::Chat object,
  • or a provider-model string, e.g. "openai/gpt-4.1", to be passed to ellmer::chat().

If client is not provided, querychat will use

  • the querychat.client R option, which can be any of the above options,
  • the QUERYCHAT_CLIENT environment variable, which should be a provider-model string,
  • or the default model from ellmer::chat_openai().

@gadenbuie gadenbuie marked this pull request as ready for review August 8, 2025 20:43
@gadenbuie gadenbuie requested review from cpsievert and jcheng5 August 8, 2025 20:45
Co-authored-by: Carson Sievert <cpsievert1@gmail.com>
@gadenbuie gadenbuie merged commit 1906d97 into main Aug 15, 2025
16 checks passed
@gadenbuie gadenbuie deleted the feat/init-client-option branch August 15, 2025 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace create_chat_func with client in querychat_init()

2 participants