Open MichaelDoyle opened 4 months ago
Do we have examples of schema for extra features that I could reference? Do we think we could render UI based on the schema or is it safer to add a code block to the model runner?
Sure, below are a bunch of examples.
I think my dream is to render based on the available options, and to even start driving validation from the underlying schema as well, even for the "stock" configurations. Right now, we set criteria for that (e.g. temp should be 0-1) in the UI code itself.
All that said, looking at some of these configuration options, it can get complicated pretty quickly. We might not want to show all of them. Maybe we need some flag/criteria for what gets rendered. There are some obvious missing ones that I think we need such as (1) safety (2) json mode (3) tool calling mode, etc.
There is also an alternative universe where we have a dotprompt style editor w/ autocomplete based on the schema.
Gemini Via Vertex:
https://github.com/firebase/genkit/blob/main/js/plugins/vertexai/src/gemini.ts#L53-L82
Open AI Compat: https://github.com/firebase/genkit/blob/main/js/plugins/vertexai/src/modelgarden/openai_compatibility.ts#L45-L53
Anthropic via Vertex https://github.com/firebase/genkit/blob/main/js/plugins/vertexai/src/modelgarden/anthropic.ts#L49-L51
Currently we do not support model parameters that are not part of the common set. For the most part, this does not impact Gemini support outside of “safety” (see #689). It’s more noticeable with OpenAI and/or Anthropic, although most of these options are fairly niche.
This feature would dynamically render and bind form elements for any known configuration option.
Note: We also need to dynamically validate model configuration, which also applies to the standard configuration options. As an example, Open AI and Gemini have different ranges for temperature. This could be driven by the underlying schema definitions for each model.