Add gpt-4-1106-preview model

This commit is contained in:
Joseph T. Lyons 2023-11-14 08:28:57 -05:00
parent 58f9ef99f7
commit 516a8790b9
9 changed files with 20 additions and 19 deletions

5
Cargo.lock generated
View file

@ -9256,9 +9256,8 @@ dependencies = [
[[package]] [[package]]
name = "tiktoken-rs" name = "tiktoken-rs"
version = "0.5.4" version = "0.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "git+https://github.com/JosephTLyons/tiktoken-rs/?rev=edb3ea9eda1b906205b346599c43c5c0e8da1392#edb3ea9eda1b906205b346599c43c5c0e8da1392"
checksum = "f9ae5a3c24361e5f038af22517ba7f8e3af4099e30e78a3d56f86b48238fce9d"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"base64 0.21.4", "base64 0.21.4",

View file

@ -160,6 +160,9 @@ pretty_assertions = "1.3.0"
git2 = { version = "0.15", default-features = false} git2 = { version = "0.15", default-features = false}
uuid = { version = "1.1.2", features = ["v4"] } uuid = { version = "1.1.2", features = ["v4"] }
# Point back to original crate when this is merged:
# https://github.com/zurawiki/tiktoken-rs/pull/49
tiktoken-rs = { git = "https://github.com/JosephTLyons/tiktoken-rs/", rev="edb3ea9eda1b906205b346599c43c5c0e8da1392" }
tree-sitter-bash = { git = "https://github.com/tree-sitter/tree-sitter-bash", rev = "7331995b19b8f8aba2d5e26deb51d2195c18bc94" } tree-sitter-bash = { git = "https://github.com/tree-sitter/tree-sitter-bash", rev = "7331995b19b8f8aba2d5e26deb51d2195c18bc94" }
tree-sitter-c = "0.20.1" tree-sitter-c = "0.20.1"
tree-sitter-cpp = { git = "https://github.com/tree-sitter/tree-sitter-cpp", rev="f44509141e7e483323d2ec178f2d2e6c0fc041c1" } tree-sitter-cpp = { git = "https://github.com/tree-sitter/tree-sitter-cpp", rev="f44509141e7e483323d2ec178f2d2e6c0fc041c1" }

View file

@ -174,7 +174,8 @@
// //
// 1. "gpt-3.5-turbo-0613"" // 1. "gpt-3.5-turbo-0613""
// 2. "gpt-4-0613"" // 2. "gpt-4-0613""
"default_open_ai_model": "gpt-4-0613" // 3. "gpt-4-1106-preview"
"default_open_ai_model": "gpt-4-1106-preview"
}, },
// Whether the screen sharing icon is shown in the os status bar. // Whether the screen sharing icon is shown in the os status bar.
"show_call_status_icon": true, "show_call_status_icon": true,
@ -270,9 +271,7 @@
"copilot": { "copilot": {
// The set of glob patterns for which copilot should be disabled // The set of glob patterns for which copilot should be disabled
// in any matching file. // in any matching file.
"disabled_globs": [ "disabled_globs": [".env"]
".env"
]
}, },
// Settings specific to journaling // Settings specific to journaling
"journal": { "journal": {
@ -381,12 +380,7 @@
// Default directories to search for virtual environments, relative // Default directories to search for virtual environments, relative
// to the current working directory. We recommend overriding this // to the current working directory. We recommend overriding this
// in your project's settings, rather than globally. // in your project's settings, rather than globally.
"directories": [ "directories": [".env", "env", ".venv", "venv"],
".env",
"env",
".venv",
"venv"
],
// Can also be 'csh', 'fish', and `nushell` // Can also be 'csh', 'fish', and `nushell`
"activate_script": "default" "activate_script": "default"
} }

View file

@ -29,7 +29,7 @@ postage.workspace = true
rand.workspace = true rand.workspace = true
log.workspace = true log.workspace = true
parse_duration = "2.1.1" parse_duration = "2.1.1"
tiktoken-rs = "0.5.0" tiktoken-rs.workspace = true
matrixmultiply = "0.3.7" matrixmultiply = "0.3.7"
rusqlite = { version = "0.29.0", features = ["blob", "array", "modern_sqlite"] } rusqlite = { version = "0.29.0", features = ["blob", "array", "modern_sqlite"] }
bincode = "1.3.3" bincode = "1.3.3"

View file

@ -29,7 +29,7 @@ postage.workspace = true
rand.workspace = true rand.workspace = true
log.workspace = true log.workspace = true
parse_duration = "2.1.1" parse_duration = "2.1.1"
tiktoken-rs = "0.5.0" tiktoken-rs.workspace = true
matrixmultiply = "0.3.7" matrixmultiply = "0.3.7"
rusqlite = { version = "0.29.0", features = ["blob", "array", "modern_sqlite"] } rusqlite = { version = "0.29.0", features = ["blob", "array", "modern_sqlite"] }
bincode = "1.3.3" bincode = "1.3.3"

View file

@ -29,7 +29,7 @@ postage.workspace = true
rand.workspace = true rand.workspace = true
log.workspace = true log.workspace = true
parse_duration = "2.1.1" parse_duration = "2.1.1"
tiktoken-rs = "0.5.0" tiktoken-rs.workspace = true
matrixmultiply = "0.3.7" matrixmultiply = "0.3.7"
rusqlite = { version = "0.29.0", features = ["blob", "array", "modern_sqlite"] } rusqlite = { version = "0.29.0", features = ["blob", "array", "modern_sqlite"] }
bincode = "1.3.3" bincode = "1.3.3"

View file

@ -40,7 +40,7 @@ schemars.workspace = true
serde.workspace = true serde.workspace = true
serde_json.workspace = true serde_json.workspace = true
smol.workspace = true smol.workspace = true
tiktoken-rs = "0.5" tiktoken-rs.workspace = true
[dev-dependencies] [dev-dependencies]
editor = { path = "../editor", features = ["test-support"] } editor = { path = "../editor", features = ["test-support"] }

View file

@ -9,6 +9,8 @@ pub enum OpenAIModel {
ThreePointFiveTurbo, ThreePointFiveTurbo,
#[serde(rename = "gpt-4-0613")] #[serde(rename = "gpt-4-0613")]
Four, Four,
#[serde(rename = "gpt-4-1106-preview")]
FourTurbo,
} }
impl OpenAIModel { impl OpenAIModel {
@ -16,6 +18,7 @@ impl OpenAIModel {
match self { match self {
OpenAIModel::ThreePointFiveTurbo => "gpt-3.5-turbo-0613", OpenAIModel::ThreePointFiveTurbo => "gpt-3.5-turbo-0613",
OpenAIModel::Four => "gpt-4-0613", OpenAIModel::Four => "gpt-4-0613",
OpenAIModel::FourTurbo => "gpt-4-1106-preview",
} }
} }
@ -23,13 +26,15 @@ impl OpenAIModel {
match self { match self {
OpenAIModel::ThreePointFiveTurbo => "gpt-3.5-turbo", OpenAIModel::ThreePointFiveTurbo => "gpt-3.5-turbo",
OpenAIModel::Four => "gpt-4", OpenAIModel::Four => "gpt-4",
OpenAIModel::FourTurbo => "gpt-4-turbo",
} }
} }
pub fn cycle(&self) -> Self { pub fn cycle(&self) -> Self {
match self { match self {
OpenAIModel::ThreePointFiveTurbo => OpenAIModel::Four, OpenAIModel::ThreePointFiveTurbo => OpenAIModel::Four,
OpenAIModel::Four => OpenAIModel::ThreePointFiveTurbo, OpenAIModel::Four => OpenAIModel::FourTurbo,
OpenAIModel::FourTurbo => OpenAIModel::ThreePointFiveTurbo,
} }
} }
} }

View file

@ -33,7 +33,7 @@ lazy_static.workspace = true
serde.workspace = true serde.workspace = true
serde_json.workspace = true serde_json.workspace = true
async-trait.workspace = true async-trait.workspace = true
tiktoken-rs = "0.5.0" tiktoken-rs.workspace = true
parking_lot.workspace = true parking_lot.workspace = true
rand.workspace = true rand.workspace = true
schemars.workspace = true schemars.workspace = true