Skip to content

Conversation

10kc-emilyk
Copy link

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):

  • PR title is following https://www.conventionalcommits.org/en/v1.0.0/
  • Tested (manually, unit tested, etc.) not yet, but i'll be doing some manual testing to verify that rouge was failing before this change
  • N/A Docs updated (updated docs or a docs bug required)

Comment on lines -20 to -50

/**
* 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;
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

1 participant