if (FALSE) {
# Define a schema with tidy data principles
json_schema <- tidyllm_schema(
name = "DocumentAnalysisSchema",
Title = "character",
Authors = "character[]",
SuggestedFilename = "character",
Type = "factor(Policy, Research)",
Answer_Q1 = "character",
Answer_Q2 = "character",
Answer_Q3 = "character",
Answer_Q4 = "character",
KeyCitations = "character[]"
)
# Pass the schema to openai()
result <- openai(
.llm = msg,
.json_schema = json_schema
)
}
Run the code above in your browser using DataLab