mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-12-01 00:08:24 +00:00
fix: forward ai proxy decisions requests on output-limited models (#12770)
This commit is contained in:
@@ -939,7 +939,8 @@ impl ModelPolicy {
|
||||
.iter()
|
||||
.any(|p| path.ends_with(p));
|
||||
if !generates {
|
||||
if ["count_tokens", "input_tokens", "embeddings"]
|
||||
// Decisions answer with short typed values and have no output-token field.
|
||||
if ["count_tokens", "input_tokens", "embeddings", "decisions"]
|
||||
.iter()
|
||||
.any(|p| path.ends_with(p))
|
||||
{
|
||||
@@ -2756,6 +2757,13 @@ mod tests {
|
||||
.unwrap(),
|
||||
raw
|
||||
);
|
||||
let raw = Bytes::from_static(br#"{"model":"gpt-4o","input":"x","questions":[]}"#);
|
||||
assert_eq!(
|
||||
policy
|
||||
.limit_body("gpt-4o", &AIProvider::OpenAI, &Standard, "decisions", &raw)
|
||||
.unwrap(),
|
||||
raw
|
||||
);
|
||||
assert_eq!(policy.output_tokens("gpt-4o", Some(100000)), Some(4000));
|
||||
assert_eq!(policy.output_tokens("gpt-4o", None), Some(4000));
|
||||
assert_eq!(policy.output_tokens("unlimited", Some(9)), Some(9));
|
||||
|
||||
Reference in New Issue
Block a user