Skip to content

Commit

Permalink
gh-226 switch used openai model to gpt4o mini (#228)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tiendil authored Jul 19, 2024
1 parent 7990acf commit 5185ba4
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
4 changes: 4 additions & 0 deletions changes/next_release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

**Recommendation:** Because `GPT-4o-mini` is much smarter than `GPT-3.5-turbo`, I recommend you to disable GPT function processor `FFUN_LIBRARIAN_OPENAI_CHAT_35_FUNCTIONS_PROCESSOR__ENABLED="False"` and use only standard GPT processor `FFUN_LIBRARIAN_OPENAI_CHAT_35_PROCESSOR__ENABLED="False"`. In [gh-227](https://github.com/Tiendil/feeds.fun/issues/227), one of the processors will be refactored, and one of them will be removed.

- [gh-226](https://github.com/Tiendil/feeds.fun/issues/226) Switch used OpenAI model to gpt4o-mini
2 changes: 0 additions & 2 deletions changes/unreleased.md

This file was deleted.

4 changes: 2 additions & 2 deletions ffun/ffun/application/user_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ class UserSetting(enum.IntEnum):
The more users set up the key, the cheaper it will be for everyone.
"""

openai_max_token_cost = decimal.Decimal("0.004")
openai_max_token_cost_n = 1000
openai_max_token_cost = (decimal.Decimal("0.150") + decimal.Decimal("0.600")) / 2
openai_max_token_cost_n = 1000000
openai_max_spendings = decimal.Decimal("10.00")

description_openai_max_tokens_in_month = f"""
Expand Down
6 changes: 3 additions & 3 deletions ffun/ffun/librarian/processors/openai_chat_3_5.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@

system = """\
You are an expert on the analysis of text semantics.
For provided text, you determine a list of best tags to describe the text.
For each category, you provide 30 tags.
For the provided text, you determine a list of best tags to describe the text.
For each category, you provide up to 30 tags.
Categories are topics, meta-topics, high-level-topics, low-level-topics, related-topics,\
Categories are topics, meta-topics, high-level-topics, low-level-topics, related-topics, \
indirect-topics, mentions, indirect-mentions.
Tags are only in English. Normalize tags and output them as JSON.\
Expand Down
6 changes: 4 additions & 2 deletions ffun/ffun/librarian/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@ class UpperCaseTitleProcessor(BaseProcessor):
pass


# TODO: will be ranamed & refactored in gh-227
class OpenAIChat35Processor(BaseProcessor):
model: str = "gpt-3.5-turbo-0125"
model: str = "gpt-4o-mini-2024-07-18"


# TODO: will be removed in gh-227
class OpenAIChat35FunctionsProcessor(BaseProcessor):
model: str = "gpt-3.5-turbo-0125"
model: str = "gpt-4o-mini-2024-07-18"


class Settings(BaseSettings):
Expand Down

0 comments on commit 5185ba4

Please sign in to comment.