-
Couldn't load subscription status.
- Fork 541
fix(js/vertexai): dedupe, improve types, fix rouge #3592
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
base: main
Are you sure you want to change the base?
fix(js/vertexai): dedupe, improve types, fix rouge #3592
Conversation
|
|
||
| /** | ||
| * Vertex AI Evaluation metrics. See API documentation for more information. | ||
| * https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/evaluation#parameter-list | ||
| */ | ||
| export enum VertexAIEvaluationMetricType { | ||
| // Update genkit/docs/plugins/vertex-ai.md when modifying the list of enums | ||
| BLEU = 'BLEU', | ||
| ROUGE = 'ROUGE', | ||
| FLUENCY = 'FLEUNCY', | ||
| SAFETY = 'SAFETY', | ||
| GROUNDEDNESS = 'GROUNDEDNESS', | ||
| SUMMARIZATION_QUALITY = 'SUMMARIZATION_QUALITY', | ||
| SUMMARIZATION_HELPFULNESS = 'SUMMARIZATION_HELPFULNESS', | ||
| SUMMARIZATION_VERBOSITY = 'SUMMARIZATION_VERBOSITY', | ||
| } | ||
|
|
||
| /** | ||
| * Evaluation metric config. Use `metricSpec` to define the behavior of the metric. | ||
| * The value of `metricSpec` will be included in the request to the API. See the API documentation | ||
| * for details on the possible values of `metricSpec` for each metric. | ||
| * https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/evaluation#parameter-list | ||
| */ | ||
| export type VertexAIEvaluationMetricConfig = { | ||
| type: VertexAIEvaluationMetricType; | ||
| metricSpec: any; | ||
| }; | ||
|
|
||
| export type VertexAIEvaluationMetric = | ||
| | VertexAIEvaluationMetricType | ||
| | VertexAIEvaluationMetricConfig; |
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.
this was duplicated from types.ts
| // Update genkit/docs/plugins/vertex-ai.md when modifying the list of enums | ||
| BLEU = 'BLEU', | ||
| ROUGE = 'ROUGE', | ||
| FLUENCY = 'FLEUNCY', |
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.
Also, note that this currently has a typo in the value:
FLEUNCY should be
FLUENCY
While investigating the appropriate types for vertex evaluators, I'm adding them here too, and discovered an incorrect type used for the ROUGE score evaluator. Also there was some code duplication with the types.
Checklist (if applicable):
Docs updated (updated docs or a docs bug required)