Skip to content

Instantly share code, notes, and snippets.

@jrosell
Created December 13, 2024 16:39
Show Gist options
  • Save jrosell/0a6481aa56f855dc3038a7c0d72184fc to your computer and use it in GitHub Desktop.
Save jrosell/0a6481aa56f855dc3038a7c0d72184fc to your computer and use it in GitHub Desktop.
library(tidychatmodels)
ollama_llama31 <-
create_chat('ollama') |>
add_model('llama3.1')
chat <-
ollama_llama31 |>
add_message('What is love? IN 10 WORDS.') |>
perform_chat()
chat |>
extract_chat()
chat <- chat |>
add_message('Now describe hate in 10 words') |>
perform_chat()
msgs <- chat |>
extract_chat()
chat <-
chat |>
add_message(
paste(
'You said: "',
msgs$message[2],
msgs$message[4],
'" Is there a relationship between these two?'
)
) |>
perform_chat()
chat |>
extract_chat()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment