-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Closed
Description
I identified GroqLM integration issue due to syntax error in below file.
https://github.com/stanfordnlp/dspy/blob/main/dsp/modules/groq_client.py
There is an issue found in line number 67 and 69
CURRENT CODE :
def log_usage(self, response):
"""Log the total tokens from the Groq API response."""
usage_data = response.get("usage")
if usage_data:
total_tokens = usage_data.get("total_tokens")
logging.debug(f"Groq Total Tokens Response Usage: {total_tokens}")
RESOLUTION:
def log_usage(self, response):
"""Log the total tokens from the Groq API response."""
# usage_data = response.get("usage")
usage_data = response.usage
if usage_data:
# total_tokens = usage_data.get("total_tokens")
total_tokens = usage_data.total_tokens
logging.debug(f"Groq Total Tokens Response Usage: {total_tokens}")
Josephrp, adam-coogan-vw and robboermanJosephrpJosephrp
Metadata
Metadata
Assignees
Labels
No labels