Skip to content

Commit

Permalink
Merge pull request #538 from rmusser01/dev
Browse files Browse the repository at this point in the history
Update Summarization_General_Lib.py
  • Loading branch information
rmusser01 authored Feb 7, 2025
2 parents 0175995 + 0ba27c2 commit 32af936
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ def summarize_with_cohere(api_key, input_data, custom_prompt_arg, temp=None, sys
else:
raise ValueError("Cohere: Invalid input data format")

cohere_model = loaded_config_data['cohere']['model']
cohere_model = loaded_config_data['cohere_api']['model']

if temp is None:
temp = 0.3
Expand Down Expand Up @@ -575,7 +575,7 @@ def stream_generator():
logging.debug("Cohere: Submitting request to API endpoint")
response = requests.post('https://api.cohere.ai/v1/chat', headers=headers, json=data)
response_data = response.json()
logging.debug("API Response Data: %s", response_data)
logging.debug(f"API Response Data: {response_data}")

if response.status_code == 200:
if 'text' in response_data:
Expand All @@ -595,7 +595,7 @@ def stream_generator():
return f"Cohere: API request failed: {response.text}"

except Exception as e:
logging.error("Cohere: Error in processing: %s", str(e), exc_info=True)
logging.error(f"Cohere: Error in processing: {str(e)}", exc_info=True)
return f"Cohere: Error occurred while processing summary with Cohere: {str(e)}"


Expand Down

0 comments on commit 32af936

Please sign in to comment.