Skip to content

Commit

Permalink
Fix: truncate_message encountered an UnboundLocalError: local variabl…
Browse files Browse the repository at this point in the history
…e 'truncated_message' referenced before assignment
  • Loading branch information
hiroshinishio committed Jul 9, 2024
1 parent 71a1a26 commit 7a1fede
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions services/openai/truncate.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

@handle_exceptions(default_return_value="", raise_on_error=False)
def truncate_message(input_message: str) -> str:
truncated_message: str = input_message
encoding: tiktoken.Encoding = tiktoken.encoding_for_model(
model_name=OPENAI_MODEL_ID
)
Expand Down

0 comments on commit 7a1fede

Please sign in to comment.