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

Update Gemini experimental model from 1121 to 1206 #251

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions src/user_preferences.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ You can set preferences for PromptingTools by setting environment variables or b
It will create a `LocalPreferences.toml` file in your current directory and will reload your prefences from there.

Check your preferences by calling `get_preferences(key::String)`.

# Available Preferences (for `set_preferences!`)
- `OPENAI_API_KEY`: The API key for the OpenAI API. See [OpenAI's documentation](https://platform.openai.com/docs/quickstart?context=python) for more information.
- `AZURE_OPENAI_API_KEY`: The API key for the Azure OpenAI API. See [Azure OpenAI's documentation](https://learn.microsoft.com/en-us/azure/ai-services/openai/reference) for more information.
Expand Down Expand Up @@ -39,12 +39,12 @@ Check your preferences by calling `get_preferences(key::String)`.
See `?LocalServerOpenAISchema` for more information and examples.
- `LOG_DIR`: The directory to save the logs to, eg, when using `SaverSchema <: AbstractTracerSchema`. Defaults to `joinpath(pwd(), "log")`. Refer to `?SaverSchema` for more information on how it works and examples.

At the moment it is not possible to persist changes to `MODEL_REGISTRY` across sessions.
At the moment it is not possible to persist changes to `MODEL_REGISTRY` across sessions.
Define your `register_model!()` calls in your `startup.jl` file to make them available across sessions or put them at the top of your script.

# Available ENV Variables
- `OPENAI_API_KEY`: The API key for the OpenAI API.
- `AZURE_OPENAI_API_KEY`: The API key for the Azure OpenAI API.
- `OPENAI_API_KEY`: The API key for the OpenAI API.
- `AZURE_OPENAI_API_KEY`: The API key for the Azure OpenAI API.
- `AZURE_OPENAI_HOST`: The host for the Azure OpenAI API. This is the URL built as `https://<resource-name>.openai.azure.com`.
- `MISTRAL_API_KEY`: The API key for the Mistral AI API.
- `COHERE_API_KEY`: The API key for the Cohere API.
Expand Down Expand Up @@ -98,7 +98,7 @@ const ALLOWED_PREFERENCES = ["MISTRAL_API_KEY",
"""
set_preferences!(pairs::Pair{String, <:Any}...)

Set preferences for PromptingTools. See `?PREFERENCES` for more information.
Set preferences for PromptingTools. See `?PREFERENCES` for more information.

See also: `get_preferences`

Expand Down Expand Up @@ -282,7 +282,7 @@ A struct that contains information about a model, such as its name, schema, cost
# Fields
- `name::String`: The name of the model. This is the name that will be used to refer to the model in the `ai*` functions.
- `schema::AbstractPromptSchema`: The schema of the model. This is the schema that will be used to generate prompts for the model, eg, `:OpenAISchema`.
- `cost_of_token_prompt::Float64`: The cost of 1 token in the prompt for this model. This is used to calculate the cost of a prompt.
- `cost_of_token_prompt::Float64`: The cost of 1 token in the prompt for this model. This is used to calculate the cost of a prompt.
Note: It is often provided online as cost per 1000 tokens, so make sure to convert it correctly!
- `cost_of_token_generation::Float64`: The cost of 1 token generated by this model. This is used to calculate the cost of a generation.
Note: It is often provided online as cost per 1000 tokens, so make sure to convert it correctly!
Expand Down Expand Up @@ -329,14 +329,14 @@ end
cost_of_token_generation::Float64 = 0.0,
description::String = "")

Register a new AI model with `name` and its associated `schema`.
Register a new AI model with `name` and its associated `schema`.

Registering a model helps with calculating the costs and automatically selecting the right prompt schema.

# Arguments
- `name`: The name of the model. This is the name that will be used to refer to the model in the `ai*` functions.
- `schema`: The schema of the model. This is the schema that will be used to generate prompts for the model, eg, `OpenAISchema()`.
- `cost_of_token_prompt`: The cost of a token in the prompt for this model. This is used to calculate the cost of a prompt.
- `cost_of_token_prompt`: The cost of a token in the prompt for this model. This is used to calculate the cost of a prompt.
Note: It is often provided online as cost per 1000 tokens, so make sure to convert it correctly!
- `cost_of_token_generation`: The cost of a token generated by this model. This is used to calculate the cost of a generation.
Note: It is often provided online as cost per 1000 tokens, so make sure to convert it correctly!
Expand Down Expand Up @@ -485,7 +485,7 @@ aliases = merge(
"gem15p" => "gemini-1.5-pro-latest",
"gem15f8" => "gemini-1.5-flash-8b-latest",
"gem15f" => "gemini-1.5-flash-latest",
"gemexp" => "gemini-exp-1121" # latest experimental model from November 2024
"gemexp" => "gemini-exp-1206" # updated experimental model from December 2024
),
## Load aliases from preferences as well
@load_preference("MODEL_ALIASES", default=Dict{String, String}()))
Expand Down Expand Up @@ -1146,11 +1146,11 @@ registry = Dict{String, ModelSpec}(
1.25e-6,
5e-6,
"Gemini Experimental Model from November 2024. Pricing assumed as per Gemini 1.5 Pro. See details [here](https://ai.google.dev/gemini-api/docs/models/experimental-models#use-an-experimental-model)."),
"gemini-exp-1121" => ModelSpec("gemini-exp-1121",
"gemini-exp-1206" => ModelSpec("gemini-exp-1206",
GoogleOpenAISchema(),
1.25e-6,
5e-6,
"Gemini Experimental Model from November 2024. Pricing assumed as per Gemini 1.5 Pro. See details [here](https://ai.google.dev/gemini-api/docs/models/experimental-models#use-an-experimental-model).")
"Gemini Experimental Model from December 2024. Pricing assumed as per Gemini 1.5 Pro. See details [here](https://ai.google.dev/gemini-api/docs/models/experimental-models#use-an-experimental-model).")
)

"""
Expand Down
Loading