diff --git a/changes/next_release.md b/changes/next_release.md new file mode 100644 index 00000000..b0fd44bf --- /dev/null +++ b/changes/next_release.md @@ -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 diff --git a/changes/unreleased.md b/changes/unreleased.md deleted file mode 100644 index 373eb997..00000000 --- a/changes/unreleased.md +++ /dev/null @@ -1,2 +0,0 @@ - -No changes. diff --git a/ffun/ffun/application/user_settings.py b/ffun/ffun/application/user_settings.py index 3c7571c5..093eeb30 100644 --- a/ffun/ffun/application/user_settings.py +++ b/ffun/ffun/application/user_settings.py @@ -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""" diff --git a/ffun/ffun/librarian/processors/openai_chat_3_5.py b/ffun/ffun/librarian/processors/openai_chat_3_5.py index a4723c34..767494f8 100644 --- a/ffun/ffun/librarian/processors/openai_chat_3_5.py +++ b/ffun/ffun/librarian/processors/openai_chat_3_5.py @@ -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.\ diff --git a/ffun/ffun/librarian/settings.py b/ffun/ffun/librarian/settings.py index 7dd31989..407fee33 100644 --- a/ffun/ffun/librarian/settings.py +++ b/ffun/ffun/librarian/settings.py @@ -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):