mirror of
https://wget.la/https://github.com/leookun/cursor-byok
synced 2026-10-09 00:16:23 +08:00
fix: align Cursor reasoning parameter metadata
This commit is contained in:
@@ -387,7 +387,7 @@ fn model_parameters(contexts: &[(String, String)]) -> Vec<ModelParameterDefiniti
|
|||||||
is_cycleable_by_hotkey: Some(false),
|
is_cycleable_by_hotkey: Some(false),
|
||||||
},
|
},
|
||||||
ModelParameterDefinition {
|
ModelParameterDefinition {
|
||||||
id: "effort".into(),
|
id: "reasoning".into(),
|
||||||
name: "Effort".into(),
|
name: "Effort".into(),
|
||||||
markdown_tooltip: Some("Effort the model uses to generate its response.".into()),
|
markdown_tooltip: Some("Effort the model uses to generate its response.".into()),
|
||||||
parameter_type: Some(ModelParameterType {
|
parameter_type: Some(ModelParameterType {
|
||||||
@@ -478,7 +478,7 @@ fn model_variant(
|
|||||||
value: context.into(),
|
value: context.into(),
|
||||||
},
|
},
|
||||||
ModelParameterValue {
|
ModelParameterValue {
|
||||||
id: "effort".into(),
|
id: "reasoning".into(),
|
||||||
value: effort.into(),
|
value: effort.into(),
|
||||||
},
|
},
|
||||||
ModelParameterValue {
|
ModelParameterValue {
|
||||||
@@ -493,7 +493,7 @@ fn model_variant(
|
|||||||
tooltip_data: Some(model_tooltip(model)),
|
tooltip_data: Some(model_tooltip(model)),
|
||||||
display_name_outside_picker: Some(display_name),
|
display_name_outside_picker: Some(display_name),
|
||||||
variant_string_representation: Some(format!(
|
variant_string_representation: Some(format!(
|
||||||
"{}[context={context},effort={effort},fast={fast}]",
|
"{}[context={context},reasoning={effort},fast={fast}]",
|
||||||
model.model_hash
|
model.model_hash
|
||||||
)),
|
)),
|
||||||
legacy_slug: Some(format!(
|
legacy_slug: Some(format!(
|
||||||
@@ -615,12 +615,12 @@ mod tests {
|
|||||||
custom_context.display_name.as_deref(),
|
custom_context.display_name.as_deref(),
|
||||||
Some("272K (Custom)")
|
Some("272K (Custom)")
|
||||||
);
|
);
|
||||||
let effort = mapped
|
let reasoning = mapped
|
||||||
.parameter_definitions
|
.parameter_definitions
|
||||||
.iter()
|
.iter()
|
||||||
.find(|parameter| parameter.id == "effort")
|
.find(|parameter| parameter.id == "reasoning")
|
||||||
.unwrap();
|
.unwrap();
|
||||||
assert!(effort
|
assert!(reasoning
|
||||||
.parameter_type
|
.parameter_type
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
@@ -642,7 +642,15 @@ mod tests {
|
|||||||
.unwrap();
|
.unwrap();
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
default.variant_string_representation.as_deref(),
|
default.variant_string_representation.as_deref(),
|
||||||
Some("33ceed20[context=200k,effort=high,fast=false]")
|
Some("33ceed20[context=200k,reasoning=high,fast=false]")
|
||||||
|
);
|
||||||
|
assert_eq!(
|
||||||
|
default
|
||||||
|
.parameter_values
|
||||||
|
.iter()
|
||||||
|
.map(|parameter| parameter.id.as_str())
|
||||||
|
.collect::<Vec<_>>(),
|
||||||
|
vec!["context", "reasoning", "fast"]
|
||||||
);
|
);
|
||||||
assert_eq!(mapped.vendor.unwrap().display_name, "Cursor");
|
assert_eq!(mapped.vendor.unwrap().display_name, "Cursor");
|
||||||
assert!(usable_model(&model).thinking_details.is_some());
|
assert!(usable_model(&model).thinking_details.is_some());
|
||||||
|
|||||||
Reference in New Issue
Block a user