Closed backslash112 closed 3 months ago
Hi @backslash112 , the description is attached with the field within the prompt.
For instance, in the intro.ipynb
notebook, the signature BasicQA
is defined as
class BasicQA(dspy.Signature):
"""Answer questions with short factoid answers."""
question = dspy.InputField()
answer = dspy.OutputField(desc="often between 1 and 5 words")
which turns into the prompt:
Answer questions with short factoid answers.
---
Follow the following format.
Question: ${question}
Answer: often between 1 and 5 words
---
Question: What is the nationality of the chef and restaurateur featured in Restaurant: Impossible?
Answer:
The description is certainly not necessary if the signature instruction covers your task requirements, but can often help in guiding the model on how to treat the corresponding Input and OutputFields.
I am reading the
text-to-sql
example from theexamples/
folder, and I have a question regarding theTextToSQLAnswer
class. I noticed that the sql output field uses a hard-written prompt in its description:My question is: Does the content of the desc parameter matter in this case? Is it used as a prompt for the model to generate the SQL query, or is it just a human-readable description?
Thanks!