Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

include_history = TRUE doesn't work #104

Open
boranhao2 opened this issue May 21, 2024 · 1 comment
Open

include_history = TRUE doesn't work #104

boranhao2 opened this issue May 21, 2024 · 1 comment

Comments

@boranhao2
Copy link

Hi, it looks like the conversation history is only loaded in console mode, but not in chat (i.e., Shiny app) mode. Could you check and resolve this? I already set include_history = TRUE for both modes

Console mode is fine:
image

Shiny app is not good:
image

@edgararuiz
Copy link
Collaborator

Hi, if you use preview = TRUE you can see exactly what's being sent to OpenAI, could this be the LLM not acknowledging or recognizing how we send the history?

> library(chattr)
> chattr_use("gpt4", include_history = TRUE)

── chattrProvider: OpenAI - Chat CompletionsPath/URL: https://api.openai.com/v1/chat/completionsModel: gpt-4Label: GPT 4 (OpenAI)

> chattr("hello")
Hello! How can I assist you with your R coding today?

> chattr("hello again", preview = TRUE)

── chattr ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

── Preview for: ConsoleProvider: OpenAI - Chat CompletionsPath/URL: https://api.openai.com/v1/chat/completionsModel: gpt-4Label: GPT 4 (OpenAI)
• temperature: 0.01max_tokens: 1000stream: TRUE

── Prompt: 
role: system
content: You are a helpful coding assistant
role: user
content: hello
role: assistant
content: Hello! How can I assist you with your R coding today?
role: user
content:
* Use the 'Tidy Modeling with R' (https://www.tmwr.org/) book as main reference
* Use the 'R for Data Science' (https://r4ds.had.co.nz/) book as main reference
* Use tidyverse packages: readr, ggplot2, dplyr, tidyr
* For models, use tidymodels packages: recipes, parsnip, yardstick, workflows, broom
* Avoid explanations unless requested by user, expecting code only
* For any line that is not code, prefix with a: #
* Keep each line of explanations to no more than 80 characters
* DO NOT use Markdown for the code
hello again

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

No branches or pull requests

2 participants