chat_fetch_messages {oaii}R Documentation

Fetch messages from response content

Description

Fetch messages (dialog data.frame with chat messages) from response content

Usage

chat_fetch_messages(res_content)

Arguments

res_content

response object returned by chat_request

Value

Messages from response as dialog data.frame (see dialog_df)

Examples

## Not run: 
  question <- dialog_df("hi")
  res_content <- chat_request(
    messages = question,
    model = "gpt-3.5-turbo"
  )
  if (!is_error(res_content)) {
    answer <- chat_fetch_messages(res_content)
    conversation <- merge_dialog_df(question, answer)
    print(conversation)
  }

## End(Not run)


[Package oaii version 0.5.0 Index]