Skip to content

Commit

Permalink
Fix compatibility issue for py3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
zh-plus committed Jun 26, 2024
1 parent 4f247fe commit 7ba85c0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion openlrc/chatbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ def __init__(self, model='gemini-1.5-flash', temperature=1, top_p=1, retry=8, ma
if base_url_config:
logger.warning('Google Gemini SDK does not support changing base_url.')

def update_fee(self, response: GenerateContentResponse | AsyncGenerateContentResponse):
def update_fee(self, response: Union[GenerateContentResponse, AsyncGenerateContentResponse]):
prompt_price, completion_price = all_pricing[self.model]

prompt_tokens = response.usage_metadata.prompt_token_count
Expand Down

0 comments on commit 7ba85c0

Please sign in to comment.