Skip to content
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

Update OpenAI model info and remove duplicate modelsinfo.py #4700

Merged
merged 3 commits into from
Jun 15, 2023

Conversation

Pwuts
Copy link
Member

@Pwuts Pwuts commented Jun 15, 2023

Background

  • OpenAI launched a set of new models last Monday
    • pricing was also updated
  • We have data duplication between autogpt.llm.providers and autogpt.llm.modelsinfo

Changes

  • Add new models to autogpt.llm.providers.openai
  • Deduplicate model info definitions using aliases
  • Remove completion_token_cost from EmbeddingModelInfo since embedding models don't output tokens
  • Update test_api_manager
    • Add a test for recording embedding model cost

Documentation

x

Test Plan

  • CI
  • Ran Auto-GPT for a couple of cycles, seems to work fine

PR Quality Checklist

  • My pull request is atomic and focuses on a single change.
  • I have thoroughly tested my changes with multiple different prompts.
  • I have considered potential risks and mitigations for my changes.
  • I have documented my changes clearly and comprehensively.
  • I have not snuck in any "extra" small tweaks changes.
  • I have run the following commands against my code to ensure it passes our linters:
    black .
    isort .
    mypy
    autoflake --remove-all-unused-imports --recursive --ignore-init-module-imports --ignore-pass-after-docstring autogpt tests --in-place

@Pwuts Pwuts added this to the v0.4.1 Release milestone Jun 15, 2023
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes here are mostly to make sure it works as a unit:

  • Semi-random values for token cost, instead of using values from the llm.providers module
  • Avoid using the same value in different variables to make sure the test also asserts correct usage of the different variables

@waynehamadi waynehamadi merged commit a1e5be7 into Release-v0.4.1 Jun 15, 2023
@waynehamadi waynehamadi deleted the update-ai-model-info branch June 15, 2023 15:14
waynehamadi added a commit to waynehamadi/Auto-GPT that referenced this pull request Jun 15, 2023
…ant-Gravitas#4700)

* Update OpenAI model info and remove duplicate modelsinfo.py

* Fix max_tokens for gpt-4-0613

Signed-off-by: Merwane Hamadi <[email protected]>
Co-authored-by: Merwane Hamadi <[email protected]>
waynehamadi added a commit that referenced this pull request Jun 15, 2023
* Update OpenAI model info and remove duplicate modelsinfo.py (#4700)

* Update OpenAI model info and remove duplicate modelsinfo.py

* Fix max_tokens for gpt-4-0613

Signed-off-by: Merwane Hamadi <[email protected]>
Co-authored-by: Merwane Hamadi <[email protected]>

* Update count_message_tokens to support new OpenAI models

Signed-off-by: Merwane Hamadi <[email protected]>
Co-authored-by: Merwane Hamadi <[email protected]>

* Fix error message in count_message_tokens

---------

Signed-off-by: Merwane Hamadi <[email protected]>
Co-authored-by: Erik Peterson <[email protected]>
Co-authored-by: Reinier van der Leer <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants