We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 1c10a9d + 50c6ae0 commit b55d340Copy full SHA for b55d340
dsp/modules/groq_client.py
@@ -64,9 +64,9 @@ def __init__(
64
65
def log_usage(self, response):
66
"""Log the total tokens from the Groq API response."""
67
- usage_data = response.get("usage")
+ usage_data = response.usage # Directly accessing the 'usage' attribute
68
if usage_data:
69
- total_tokens = usage_data.get("total_tokens")
+ total_tokens = usage_data.total_tokens
70
logging.debug(f"Groq Total Tokens Response Usage: {total_tokens}")
71
72
def basic_request(self, prompt: str, **kwargs):
0 commit comments