Skip to content

Commit

Permalink
fix: increase AI gen timeout + upgrade to 16k gpt4o (#4340)
Browse files Browse the repository at this point in the history
  • Loading branch information
HugoCasa authored Sep 4, 2024
1 parent f4446f2 commit 067110e
Show file tree
Hide file tree
Showing 4 changed files with 130 additions and 44 deletions.
13 changes: 9 additions & 4 deletions backend/windmill-api/src/openai.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
use std::collections::HashMap;

use crate::{
db::{ApiAuthed, DB},
HTTP_CLIENT,
};
use crate::db::{ApiAuthed, DB};

use axum::{
body::Bytes,
Expand All @@ -13,6 +10,7 @@ use axum::{
Router,
};
use quick_cache::sync::Cache;
use reqwest::Client;
use serde_json::value::RawValue;
use windmill_audit::audit_ee::audit_log;
use windmill_audit::ActionKind;
Expand All @@ -24,6 +22,13 @@ use windmill_common::{
use crate::variables::decrypt;
use serde::Deserialize;

lazy_static::lazy_static! {
static ref HTTP_CLIENT: Client = reqwest::ClientBuilder::new()
.timeout(std::time::Duration::from_secs(60 * 5))
.user_agent("windmill/beta")
.build().unwrap();
}

pub fn workspaced_service() -> Router {
let router = Router::new().route("/proxy/*openai_path", post(proxy));

Expand Down
155 changes: 118 additions & 37 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
"monaco-languageclient": "~8.8.2",
"monaco-vim": "^0.4.1",
"ol": "^7.4.0",
"openai": "^4.47.1",
"openai": "^4.57.2",
"p-limit": "^6.1.0",
"pdfjs-dist": "^3.8.162",
"quill": "^1.3.7",
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/lib/components/copilot/lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ export const SUPPORTED_LANGUAGES = new Set(Object.keys(GEN_CONFIG.prompts))

const openaiConfig: ChatCompletionCreateParamsStreaming = {
temperature: 0,
max_tokens: 4096,
model: 'gpt-4o-2024-05-13',
max_tokens: 16384,
model: 'gpt-4o-2024-08-06',
seed: 42,
stream: true,
messages: []
Expand Down

0 comments on commit 067110e

Please sign in to comment.