fix(token_counter): fix panic with GitHub Copilot (#4632)
Signed-off-by: sings-to-bees-on-wednesdays <222684290+sings-to-bees-on-wednesdays@users.noreply.github.com> main was broken. this seems important
This commit is contained in:
committed by
GitHub
parent
b9ba8dca29
commit
509fcac69d
@@ -90,7 +90,9 @@ impl AsyncTokenCounter {
|
||||
let line = format!("{}:{}", name, description);
|
||||
func_token_count += self.count_tokens(&line);
|
||||
|
||||
if let serde_json::Value::Object(properties) = &tool.input_schema["properties"] {
|
||||
if let Some(serde_json::Value::Object(properties)) =
|
||||
tool.input_schema.get("properties")
|
||||
{
|
||||
if !properties.is_empty() {
|
||||
func_token_count += prop_init;
|
||||
for (key, value) in properties {
|
||||
|
||||
Reference in New Issue
Block a user