Repository: Significant-Gravitas/AutoGPT
Pull request: feat(forge/llm): Add basic support for GPT-4o
### **User description**
### Background

<!-- Clearly explain the need for these changes: -->

Open AI recently released GPT-4o

### Changes 🏗️

<!-- Concisely describe all of the changes made in this pull request: -->

Adds a new model info for GPT-4o

Closes #7155 

### PR Quality Scorecard ✨

<!--
Check out our contribution guide:
https://github.com/Significant-Gravitas/Nexus/wiki/Contributing

1. Avoid duplicate work, issues, PRs etc.
2. Also consider contributing something other than code; see the [contribution guide]
   for options.
3. Clearly explain your changes.
4. Avoid making unnecessary changes, especially if they're purely based on personal
   preferences. Doing so is the maintainers' job. ;-)
-->

- [x] Have you used the PR description template? &ensp; `+2 pts`
- [x] Is your pull request atomic, focusing on a single change? &ensp; `+5 pts`
- [x] Have you linked the GitHub issue(s) that this PR addresses? &ensp; `+5 pts`
- [ ] Have you documented your changes clearly and comprehensively? &ensp; `+5 pts`
- [ ] Have you changed or added a feature? &ensp; `-4 pts`
  - [ ] Have you added/updated corresponding documentation? &ensp; `+4 pts`
  - [ ] Have you added/updated corresponding integration tests? &ensp; `+5 pts`
- [ ] Have you changed the behavior of AutoGPT? &ensp; `-5 pts`
  - [ ] Have you also run `agbenchmark` to verify that these changes do not regress performance? &ensp; `+10 pts`


___

### **PR Type**
Enhancement


___

### **Description**
- Added `GPT4_O` and `GPT4_O_ROLLING` to the `OpenAIModelName` enum.
- Introduced `ChatModelInfo` for `GPT4_O` with specific token costs and max tokens.



___



### **Changes walkthrough** 📝
<table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Enhancement
</strong></td><td><table>
<tr>
  <td>
    <details>
      <summary><strong>openai.py</strong><dd><code>Add support for GPT-4O model in OpenAI provider</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>
      
forge/forge/llm/providers/openai.py

<li>Added <code>GPT4_O</code> and <code>GPT4_O_ROLLING</code> to <code>OpenAIModelName</code> enum.<br> <li> Introduced <code>ChatModelInfo</code> for <code>GPT4_O</code> with specific token costs and max <br>tokens.<br>


</details>
    

  </td>
  <td><a href="https://github.com/Significant-Gravitas/AutoGPT/pull/7169/files#diff-8ad06a400003efdd02abe8e5983a6f44468fe9abb3cc89103030208033bcd9f5">+10/-0</a>&nbsp; &nbsp; </td>

</tr>                    
</table></td></tr></tr></tbody></table>

___

> 💡 **PR-Agent usage**:
>Comment `/help` on the PR to get a list of all available PR-Agent tools and their descriptions



Problem statement:
support for gpt-4o?
### Duplicates

- [X] I have searched the existing issues

### Summary 💡

was wondering when this would be supported or how i might add it myself if it's just a text value in a collection.  the application rejects it on start as not being valid

### Examples 🌈

_No response_

### Motivation 🔦

_No response_

Hints from issue discussion:
update:  i tracked down what needs to be done here, aside from updating the openai provider

the tiktoken package needs to be updated to 0.7.0 which has gpt-4o

however it cannot be updated because autogpt-forge 0.1.0 has a hard requirement of 0.5.0 tiktoken

but if you upgrade to autogpt-forge 0.1.4 which supports a higher version of tiktoken, there are a bunch of references in the current project that are broken, forge.logging at least.  i really need to get back to work on my day job so it would be pretty cash money if someone solved this, i'm able to run locally fine by manually editing the package but its not the real fix
Any updates on this?

Commit message: Merge branch 'master' into gpt4-o

Patch to review:
diff --git a/forge/forge/llm/providers/openai.py b/forge/forge/llm/providers/openai.py
index 7f0d55384630..2bdc6c6ddb99 100644
--- a/forge/forge/llm/providers/openai.py
+++ b/forge/forge/llm/providers/openai.py
@@ -80,6 +80,8 @@ class OpenAIModelName(str, enum.Enum):
     GPT4_VISION = "gpt-4-vision-preview"
     GPT4 = GPT4_ROLLING
     GPT4_32k = GPT4_ROLLING_32k
+    GPT4_O = "gpt-4o-2024-05-13"
+    GPT4_O_ROLLING = GPT4_O
 
 
 OPEN_AI_EMBEDDING_MODELS = {
@@ -169,6 +171,14 @@ class OpenAIModelName(str, enum.Enum):
             max_tokens=128000,
             has_function_call_api=True,
         ),
+        ChatModelInfo(
+            name=OpenAIModelName.GPT4_O,
+            provider_name=ModelProviderName.OPENAI,
+            prompt_token_cost=5 / 1_000_000,
+            completion_token_cost=15 / 1_000_000,
+            max_tokens=128_000,
+            has_function_call_api=True,
+        ),
     ]
 }
 # Copy entries for models with equivalent specs


Code review comments:
diff_hunk: @@ -80,6 +80,8 @@ class OpenAIModelName(str, enum.Enum):
     GPT4_VISION = "gpt-4-vision-preview"
     GPT4 = GPT4_ROLLING
     GPT4_32k = GPT4_ROLLING_32k
+    GPT4_O = "gpt-4o-2024-05-13"
+    GPT4_O_ROLLING = GPT4_O
path: forge/forge/llm/providers/openai.py
text: @user1:
I think we want https://platform.openai.com/docs/models/gpt-4o
```suggestion
    GPT4_O_ROLLING = "gpt-4o"
    GPT4_O = GPT4_O_ROLLING
```

@user2:
yes