Skip to content

Commit 7358605

Browse files
committed
docs(pky-py): Update client examples
1 parent 25af326 commit 7358605

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

pkg-py/docs/index.qmd

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ This dataset contains information about Titanic passengers, collected for predic
138138
which you can then pass via:
139139

140140
```python
141-
querychat_config = querychat.init(
141+
qc_config = querychat.init(
142142
titanic,
143143
"titanic",
144144
data_description=Path("data_description.md")
@@ -152,7 +152,7 @@ querychat doesn't need this information in any particular format; just put whate
152152
You can add additional instructions of your own to the end of the system prompt, by passing `extra_instructions` into `querychat.init`.
153153

154154
```python
155-
querychat_config = querychat.init(
155+
qc_config = querychat.init(
156156
titanic,
157157
"titanic",
158158
extra_instructions=[
@@ -172,23 +172,13 @@ You can also put these instructions in a separate file and use `Path("instructio
172172
By default, querychat uses GPT-4o via the OpenAI API. If you want to use a different model, you can provide a `create_chat_callback` function that takes a `system_prompt` parameter, and returns a chatlas Chat object:
173173

174174
```python
175+
import querychat
175176
import chatlas
176-
from functools import partial
177177

178-
# Option 1: Define a function
179-
def my_chat_func(system_prompt: str) -> chatlas.Chat:
180-
return chatlas.ChatAnthropic(
181-
model="claude-3-7-sonnet-latest",
182-
system_prompt=system_prompt
183-
)
184-
185-
# Option 2: Use partial
186-
my_chat_func = partial(chatlas.ChatAnthropic, model="claude-3-7-sonnet-latest")
187-
188-
querychat_config = querychat.init(
178+
qc_config = querychat.init(
189179
titanic,
190180
"titanic",
191-
create_chat_callback=my_chat_func
181+
client=chatlas.ChatAnthropic(model="claude-3-7-sonnet-latest")
192182
)
193183
```
194184

0 commit comments

Comments
 (0)