Skip to content

Commit

Permalink
update Google Gemini model
Browse files Browse the repository at this point in the history
  • Loading branch information
svilupp committed Nov 23, 2024
1 parent aa481ab commit eab182e
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 62 deletions.
16 changes: 12 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

## [0.65.0]

### Breaking
- Changed the official ENV variable for MistralAI API from `MISTRALAI_API_KEY` to `MISTRAL_API_KEY` to be compatible with the Mistral docs.

### Added
- Added a new Gemini Experimental model from November 2024 (`gemini-exp-1121` with alias `gemexp`).

### Updated
- Changed the ENV variable for MistralAI API from `MISTRALAI_API_KEY` to `MISTRAL_API_KEY` to be compatible with the Mistral docs.

## [0.64.0]

### Added
Expand Down Expand Up @@ -618,13 +629,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [0.4.0]

### Breaking
- Changed the official ENV variable for MistralAI API from `MISTRALAI_API_KEY` to `MISTRAL_API_KEY` to be compatible with the Mistral docs.

### Added
- Improved AICode parsing and error handling (eg, capture more REPL prompts, detect parsing errors earlier, parse more code fence types), including the option to remove unsafe code (eg, `Pkg.add("SomePkg")`) with `AICode(msg; skip_unsafe=true, vebose=true)`
- Added new prompt templates: `JuliaRecapTask`, `JuliaRecapCoTTask`, `JuliaExpertTestCode` and updated `JuliaExpertCoTTask` to be more robust against early stopping for smaller OSS models
- Added support for MistralAI API via the MistralOpenAISchema(). All their standard models have been registered, so you should be able to just use `model="mistral-tiny` in your `aigenerate` calls without any further changes. Remember to either provide `api_kwargs.api_key` or ensure you have ENV variable `MISTRAL_API_KEY` set.
- Added support for MistralAI API via the MistralOpenAISchema(). All their standard models have been registered, so you should be able to just use `model="mistral-tiny` in your `aigenerate` calls without any further changes. Remember to either provide `api_kwargs.api_key` or ensure you have ENV variable `MISTRALAI_API_KEY` set. Note: This has been since changed to `MISTRAL_API_KEY` to be compatible with the Mistral docs, refer to the versions after v0.65.
- Added support for any OpenAI-compatible API via `schema=CustomOpenAISchema()`. All you have to do is to provide your `api_key` and `url` (base URL of the API) in the `api_kwargs` keyword argument. This option is useful if you use [Perplexity.ai](https://docs.perplexity.ai/), [Fireworks.ai](https://app.fireworks.ai/), or any other similar services.

## [0.3.0]
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "PromptingTools"
uuid = "670122d1-24a8-4d70-bfce-740807c42192"
authors = ["J S @svilupp and contributors"]
version = "0.64.0"
version = "0.65.0"

[deps]
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
Expand Down
11 changes: 8 additions & 3 deletions src/user_preferences.jl
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ function load_api_keys!()
AZURE_OPENAI_HOST = @load_preference("AZURE_OPENAI_HOST",
default=get(ENV, "AZURE_OPENAI_HOST", ""))
global MISTRAL_API_KEY
MISTRAL_API_KEY = @load_preference("MISTRAL_API_KEY",
default=get(ENV, "MISTRAL_API_KEY",
MISTRAL_API_KEY = @load_preference("MISTRAL_API_KEY",
default=get(ENV, "MISTRAL_API_KEY",
get(ENV, "MISTRALAI_API_KEY", "")))
if !isempty(get(ENV, "MISTRALAI_API_KEY", ""))
@warn "The MISTRALAI_API_KEY environment variable is deprecated. Use MISTRAL_API_KEY instead."
Expand Down Expand Up @@ -483,7 +483,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-1114" # latest experimental model from November 2024
"gemexp" => "gemini-exp-1121" # latest experimental model from November 2024
),
## Load aliases from preferences as well
@load_preference("MODEL_ALIASES", default=Dict{String, String}()))
Expand Down Expand Up @@ -1130,6 +1130,11 @@ registry = Dict{String, ModelSpec}(
3.0e-7,
"Gemini 1.5 Flash is a high-performance model optimized for speed while maintaining strong capabilities across various tasks. 128K context window."),
"gemini-exp-1114" => ModelSpec("gemini-exp-1114",
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-exp-1121" => ModelSpec("gemini-exp-1121",
GoogleOpenAISchema(),
1.25e-6,
5e-6,
Expand Down
54 changes: 0 additions & 54 deletions test_analysis.txt

This file was deleted.

0 comments on commit eab182e

Please sign in to comment.