Skip to content
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

Simpler evaluations — part 2.4 #533

Merged
merged 1 commit into from
Nov 4, 2024
Merged

Conversation

csansoon
Copy link
Contributor

@csansoon csansoon commented Nov 4, 2024

Part 2.4

Although legacy evaluation configuration is still available from the metadata (the configuration jsonb column), all the code has been adapted to use the new configuration attribute instead (the respective EvaluationConfiguration table for each result type).

Additionally, added the prompt that will generate from the configuration of the new "simple evaluations"

Comment on lines 71 to 107
`
---
provider: ${providerResult.value!.name}
model: ${evaluation.metadata.model}
temperature: 0.2
schema:
type: object
properties:
result:
type: ${resultSchema[evaluation.resultType]}
reason:
type: string
required:
- value
- reason
---

You’re an expert LLM evaluator. Your objective is to evaluate the response from an LLM model based on this goal:

${evaluation.metadata.objective}

${evaluation.metadata.additionalInstructions ? 'Additionally, you should follow these instructions:\n\n' + evaluation.metadata.additionalInstructions : ''}

Now, evaluate the assistant response for the following conversation, based on your instructions:

{{ messages.all }}

Also, here is some aditional metadata about the LLM response. It may or may not be relevant to your objective.
- Cost: {{ cost }} cents.
- Duration: {{ duration }} milliseconds.

You must respond with a JSON object with the following properties:
- value: ${valueInformation(evaluation)}
- reason: A string explaining your evaluation decision.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The evaluation that will be generated from the new "simple evaluations" configuration!

@csansoon csansoon force-pushed the simpler_evaluations_part_2.4 branch 4 times, most recently from 8249b97 to 84d0e4b Compare November 4, 2024 10:02

You must respond with a JSON object with the following properties:
- value: ${valueInformation(evaluation)}
- reason: A string explaining your evaluation decision.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is that even necessary? we are already adding a json schema and structure output in the ai request

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also adds the descriptions for these values, which are defined for the user. Also, OpenAI recommends to explain the schema in the context in addition to defining it in the configuration.

Copy link
Collaborator

@geclos geclos Nov 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

description can also be added in the json schema then

andresgutgon
andresgutgon previously approved these changes Nov 4, 2024
@csansoon csansoon force-pushed the simpler_evaluations_part_2.4 branch 2 times, most recently from 6c67335 to c97f2e3 Compare November 4, 2024 11:05
@csansoon csansoon force-pushed the simpler_evaluations_part_2.4 branch from c97f2e3 to 1106ebb Compare November 4, 2024 11:13
@csansoon csansoon merged commit 3f35951 into main Nov 4, 2024
3 checks passed
@csansoon csansoon deleted the simpler_evaluations_part_2.4 branch November 4, 2024 11:24
@github-actions github-actions bot locked and limited conversation to collaborators Nov 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants