Skip to content

Commit

Permalink
openai proxy setting in env example, other model in admin
Browse files Browse the repository at this point in the history
  • Loading branch information
yinan-c committed Jul 21, 2024
1 parent b20f732 commit 3b1aec6
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 5 deletions.
7 changes: 6 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,9 @@ OPENAI_API_KEY=your_open_ai_api_key

# Change the `DEPLOYMENT_URL` to `hostname.yourdomain.tld` if you deploy with your domain.
# If you just are running the app locally, you can leave it or set empty.
DEPLOYMENT_URL=hostname.yourdomain.tld
DEPLOYMENT_URL=hostname.yourdomain.tld

# Uncomment the following for customed OPENAI API, e.g. Using OneAPI
# If you are using OpenAI API only, leave it as it is.
#OPENAI_PROXY=
#OPENAI_BASE_URL='https://api.openai.com/v1'
2 changes: 1 addition & 1 deletion FeedManager/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def original_feed_count(self, obj):
'fields': ('toggle_entries', 'toggle_digest', 'digest_frequency', 'last_digest'),#, 'include_one_line_summary', 'include_summary', 'include_content', 'use_ai_digest', 'digest_model', 'additional_prompt_for_digest','send_full_article'),
}),
('What to include in digest', {
'fields': ('include_toc', 'include_one_line_summary', 'include_summary', 'include_content', 'use_ai_digest', 'digest_model', 'additional_prompt_for_digest', 'send_full_article'),
'fields': ('include_toc', 'include_one_line_summary', 'include_summary', 'include_content', 'use_ai_digest', 'digest_model', 'other_digest_model', 'additional_prompt_for_digest', 'send_full_article'),
}),
)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Generated by Django 5.0.6 on 2024-07-21 02:02

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('FeedManager', '0022_processedfeed_other_digest_model_and_more'),
]

operations = [
migrations.AlterField(
model_name='processedfeed',
name='digest_model',
field=models.CharField(choices=[('gpt-3.5-turbo', 'GPT-3.5 Turbo'), ('gpt-4-turbo', 'GPT-4 Turbo'), ('gpt-4o', 'GPT-4o'), ('gpt-4o-mini', 'GPT-4o Mini'), ('other', 'Other (specify below)')], default='gpt-3.5-turbo', help_text='Model for digest generation.', max_length=20),
),
migrations.AlterField(
model_name='processedfeed',
name='model',
field=models.CharField(choices=[('gpt-3.5-turbo', 'GPT-3.5 Turbo'), ('gpt-4-turbo', 'GPT-4 Turbo'), ('gpt-4o', 'GPT-4o'), ('gpt-4o-mini', 'GPT-4o Mini'), ('other', 'Other (specify below)')], default='gpt-3.5-turbo', max_length=20),
),
migrations.AlterField(
model_name='processedfeed',
name='other_digest_model',
field=models.CharField(blank=True, default='', help_text="Please specify the model if 'Other' is selected above, e.g. 'gemini-1.5-pro' in OneAPI.", max_length=255),
),
migrations.AlterField(
model_name='processedfeed',
name='other_model',
field=models.CharField(blank=True, default='', help_text="Please specify the model if 'Other' is selected above, e.g. 'gemini-1.5-pro' in OneAPI.", max_length=255),
),
]
6 changes: 3 additions & 3 deletions FeedManager/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ class ProcessedFeed(models.Model):
('gpt-4-turbo', 'GPT-4 Turbo'),
('gpt-4o', 'GPT-4o'),
('gpt-4o-mini', 'GPT-4o Mini'),
('other', 'Other'),
('other', 'Other (specify below)'),
]
model = models.CharField(max_length=20, default='gpt-3.5-turbo', choices=choices)
other_model = models.CharField(max_length=255, blank=True, default='', help_text="AI Model for summarization, only used if 'Other' is selected.")
other_model = models.CharField(max_length=255, blank=True, default='', help_text="Please specify the model if 'Other' is selected above, e.g. 'gemini-1.5-pro' in OneAPI.")

# Digest related fields
toggle_digest = models.BooleanField(default=False, help_text="Send a digest of the feed regularly.")
Expand All @@ -70,7 +70,7 @@ class ProcessedFeed(models.Model):
use_ai_digest = models.BooleanField(default=False, help_text="Use AI to process digest content.")
send_full_article = models.BooleanField(default=False, help_text="(Ignored without prompt) Send full article content for AI digest, by default only link, title, and summary are sent.")
digest_model = models.CharField(max_length=20, default='gpt-3.5-turbo', choices=choices, help_text="Model for digest generation.")
other_digest_model = models.CharField(max_length=255, blank=True, default='', help_text="AI Model for digest generation, only used if 'Other' is selected.")
other_digest_model = models.CharField(max_length=255, blank=True, default='', help_text="Please specify the model if 'Other' is selected above, e.g. 'gemini-1.5-pro' in OneAPI.")
additional_prompt_for_digest = models.TextField(blank=True, default='', verbose_name='(Optional) Prompt for Digest', help_text="Using AI to generate digest, otherwise only the title, link and summary from the database will be included in the digest.")

# Filter related fields
Expand Down

0 comments on commit 3b1aec6

Please sign in to comment.