Skip to content

Instantly share code, notes, and snippets.

@ashen007
Created April 26, 2025 06:43
Show Gist options
  • Select an option

  • Save ashen007/11e02711aa583d30eac089956f499cf6 to your computer and use it in GitHub Desktop.

Select an option

Save ashen007/11e02711aa583d30eac089956f499cf6 to your computer and use it in GitHub Desktop.
{
'answer': '[{"title": "TELEGRAPH VOYAGE", "revenue": Decimal("231.73")}, {"title": "GOODFELLAS SALUTE", "revenue": Decimal("209.69")}, {"title": "TITANS JERK", "revenue": Decimal("201.71")}]',
'messages': [HumanMessage(content='what are the top 3 in-term of revenue in PG rating films?',
id='724a1d3c-7915-4cd3-85c0-7ba2a6736f12'), AIMessage(content='', additional_kwargs={
'tool_calls': [{'id': 'call_fvz7', 'function': {
'arguments': '{"query":"SELECT f.title, SUM(p.amount) as revenue FROM film f JOIN inventory i ON f.film_id = i.film_id JOIN rental r ON i.inventory_id = r.inventory_id JOIN payment p ON r.rental_id = p.rental_id WHERE f.rating=\'PG\' GROUP BY f.title ORDER BY revenue DESC LIMIT 3"}',
'name': 'db_query_tool'}, 'type': 'function'}]}, response_metadata={
'token_usage': {'completion_tokens': 135, 'prompt_tokens': 2007, 'total_tokens': 2142,
'completion_time': 0.43354108, 'prompt_time': 0.168751257,
'queue_time': 0.004758699000000005, 'total_time': 0.602292337},
'model_name': 'llama3-70b-8192', 'system_fingerprint': 'fp_c1a4bcec29', 'finish_reason': 'tool_calls',
'logprobs': None}, id='run-d370a7e1-c1e3-44f4-8c0c-81ebb4bd2652-0', tool_calls=[{'name': 'db_query_tool',
'args': {
'query': "SELECT f.title, SUM(p.amount) as revenue FROM film f JOIN inventory i ON f.film_id = i.film_id JOIN rental r ON i.inventory_id = r.inventory_id JOIN payment p ON r.rental_id = p.rental_id WHERE f.rating='PG' GROUP BY f.title ORDER BY revenue DESC LIMIT 3"},
'id': 'call_fvz7',
'type': 'tool_call'}]),
ToolMessage(
content="[{'title': 'TELEGRAPH VOYAGE', 'revenue': Decimal('231.73')}, {'title': 'GOODFELLAS SALUTE', 'revenue': Decimal('209.69')}, {'title': 'TITANS JERK', 'revenue': Decimal('201.71')}]",
name='db_query_tool', id='ad92694d-ba63-47c1-a026-dcd53d4e4681', tool_call_id='call_fvz7')]}[
{"title": "TELEGRAPH VOYAGE", "revenue": Decimal("231.73")}, {"title": "GOODFELLAS SALUTE",
"revenue": Decimal("209.69")}, {
"title": "TITANS JERK", "revenue": Decimal("201.71")}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment