-
Notifications
You must be signed in to change notification settings - Fork 310
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
Jacques/evaluate prompt #1023
Jacques/evaluate prompt #1023
Conversation
processed_messages.append( | ||
{ | ||
"role": message["role"], | ||
"content": pystache.render(message["content"], prompt_variables), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can use opik.api_objects.prompt.prompt_template.PromptTemplate
class. It does pretty much the same stuff as pystache
and has special errors for the cases when variables don't match the template.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated but I had to turn off the validation since we only want the validation only if one of the variables in the prompt is not updated. But at least we don't have an extra dependency
|
||
verbose: an integer value that controls evaluation output logs such as summary and tqdm progress bar. | ||
""" | ||
if isinstance(model, str): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if isinstance(model, str):
model = models_factory.get(model_name=model)
elif not isinstance(model, base_model.OpikBaseModel):
raise ValueError("`model` must be either a string or an OpikBaseModel instance")
…name from the parent span to the params, add error_callback as well
Details
Updated the evaluation documentation and fixed various issues in the docs