Skip to content

[Issue]: zero cost in chat_res.cost while already called the openai gpt-3.5-turbo #2000

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
yanan1116 opened this issue Mar 13, 2024 · 1 comment

Comments

@yanan1116
Copy link

Describe the issue

hi, i am trying to follow examples on my own workstation.
such as this one : https://github.com/microsoft/autogen/blob/main/notebook/agentchat_auto_feedback_from_code_execution.ipynb

the issue is that there is zero cost in Cost info: Cost info: ({'total_cost': 0, 'gpt-3.5-turbo-0125': {'cost': 0, 'prompt_tokens': 3941, 'completion_tokens': 587, 'total_tokens': 4528}}, {'total_cost': 0, 'gpt-3.5-turbo-0125': {'cost': 0, 'prompt_tokens': 3941, 'completion_tokens': 587, 'total_tokens': 4528}})

actually, i use gpt-3.5-turbo-0125 in config_list instead of gpt-4; while other codes are the same with the example code

execution result:

user_proxy (to assistant):

What date is today? Compare the year-to-date gain for META and TESLA.


assistant (to user_proxy):

To get today's date, we can use Python. Let's first get the current date and then we can proceed to compare the year-to-date gain for META and TESLA.

Here is the Python code to get today's date:

# filename: get_date.py
from datetime import date

today = date.today()
print(today)

Please run the code above to get today's date. After that, we can proceed with comparing the year-to-date gain for META and TESLA.


EXECUTING CODE BLOCK 0 (inferred language is python)...
user_proxy (to assistant):

exitcode: 0 (execution succeeded)
Code output:
2024-03-13


assistant (to user_proxy):

Great! Today's date is March 13, 2024.

Now, to compare the year-to-date gain for META and TESLA, we would typically need the stock prices at the beginning of the year and the current stock prices for both companies. Since I don't have real-time data, I will provide a general approach using placeholder values for demonstration purposes.

Let's assume the following placeholder values:

  • META stock price at the beginning of the year: $100
  • META current stock price: $120
  • TESLA stock price at the beginning of the year: $800
  • TESLA current stock price: $900

We will calculate the year-to-date gain for both META and TESLA based on these placeholder values.

Here is the Python code to compare the year-to-date gain for META and TESLA:

# Placeholder values for demonstration
meta_start_price = 100
meta_current_price = 120
tesla_start_price = 800
tesla_current_price = 900

# Calculate year-to-date gain for META and TESLA
meta_ytd_gain = ((meta_current_price - meta_start_price) / meta_start_price) * 100
tesla_ytd_gain = ((tesla_current_price - tesla_start_price) / tesla_start_price) * 100

print("META year-to-date gain: {:.2f}%".format(meta_ytd_gain))
print("TESLA year-to-date gain: {:.2f}%".format(tesla_ytd_gain))

Please run the code above to compare the year-to-date gain for META and TESLA based on the placeholder values. If you have the actual stock prices, you can replace the placeholder values with the real data for a more accurate comparison.


EXECUTING CODE BLOCK 0 (inferred language is python)...
user_proxy (to assistant):

exitcode: 0 (execution succeeded)
Code output:
META year-to-date gain: 20.00%
TESLA year-to-date gain: 12.50%


assistant (to user_proxy):

Based on the placeholder values provided, the year-to-date gain for META is 20.00% and for TESLA is 12.50%.

If you have the actual stock prices, you can replace the placeholder values in the code with the real data to get a more accurate comparison.

Is there anything else you would like assistance with? If not, please type "TERMINATE".


user_proxy (to assistant):


assistant (to user_proxy):

TERMINATE


Steps to reproduce

No response

Screenshots and logs

image

Additional Information

autogen version: 0.2.17

@yanan1116 yanan1116 changed the title [Issue]: blank user_proxy (to assistant) when following the examples [Issue]: zero cost in chat_res.cost while already called the openai gpt-3.5-turbo Mar 13, 2024
@yiranwu0
Copy link
Contributor

yiranwu0 commented Apr 10, 2024

This is because "gpt-3.5-turbo-0125" is not stored in OAI_PRICE, but it is added now in #2332

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants