mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-04 12:50:38 +08:00
readme
This commit is contained in:
@ -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}")
|
||||||
|
Reference in New Issue
Block a user