mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-12-12 02:45:18 +00:00
readme
This commit is contained in:
parent
aa2121a48d
commit
2be0e9108e
1 changed files with 1 additions and 1 deletions
|
|
@ -575,7 +575,7 @@ def clip_tokens(text: str, max_tokens: int, add_three_dots=True) -> str:
|
||||||
num_output_chars = int(chars_per_token * max_tokens)
|
num_output_chars = int(chars_per_token * max_tokens)
|
||||||
clipped_text = text[:num_output_chars]
|
clipped_text = text[:num_output_chars]
|
||||||
if add_three_dots:
|
if add_three_dots:
|
||||||
clipped_text += "...(truncated)"
|
clipped_text += " ...(truncated)"
|
||||||
return clipped_text
|
return clipped_text
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
get_logger().warning(f"Failed to clip tokens: {e}")
|
get_logger().warning(f"Failed to clip tokens: {e}")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue