-
Notifications
You must be signed in to change notification settings - Fork 8
Generation Pipeline Revamp #115
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
Open
rasulkireev
wants to merge
4
commits into
main
Choose a base branch
from
generation-pipeline-revamp
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| from pydantic_ai import Agent | ||
|
|
||
| from core.agents.system_prompts import ( | ||
| add_webpage_content, | ||
| ) | ||
| from core.choices import get_default_ai_model | ||
| from core.schemas import ( | ||
| ProjectDetails, | ||
| WebPageContent, | ||
| ) | ||
|
|
||
| agent = Agent( | ||
| get_default_ai_model(), | ||
| output_type=ProjectDetails, | ||
| deps_type=WebPageContent, | ||
| system_prompt=( | ||
| "You are an expert content analyzer. Based on the content provided, " | ||
| "extract and infer the requested information. Make reasonable inferences based " | ||
| "on available content, context, and industry knowledge." | ||
| ), | ||
| retries=2, | ||
| ) | ||
| agent.system_prompt(add_webpage_content) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| from pydantic_ai import Agent | ||
|
|
||
| from core.agents.system_prompts import ( | ||
| add_language_specification, | ||
| add_project_details, | ||
| add_project_pages, | ||
| add_target_keywords, | ||
| add_title_details, | ||
| ) | ||
| from core.choices import get_default_ai_model | ||
| from core.schemas import BlogPostGenerationContext, BlogPostStructure | ||
|
|
||
| agent = Agent( | ||
| get_default_ai_model(), | ||
| output_type=BlogPostStructure, | ||
| deps_type=BlogPostGenerationContext, | ||
| system_prompt=""" | ||
| You are an expert content strategist and SEO specialist. | ||
|
|
||
| Your task is to create a comprehensive, well-structured outline for a blog post. | ||
| Think deeply about: | ||
|
|
||
| 1. **Logical Flow**: How should information be presented for maximum clarity and impact? | ||
| 2. **SEO Optimization**: What headings and structure will rank well in search engines? | ||
| 3. **User Intent**: What questions does the reader have, and in what order should they be answered? | ||
| 4. **Comprehensiveness**: What topics must be covered for this to be a complete resource? | ||
| 5. **Readability**: How can we break down complex topics into digestible sections? | ||
|
|
||
| Consider the project details, title suggestion, and available project pages when creating the structure. | ||
| The structure should be detailed enough that a writer can follow it to create excellent content. | ||
|
|
||
| Important guidelines: | ||
| - Use H2 (level 2) for main sections | ||
| - Use H3 (level 3) for subsections within main sections | ||
| - Aim for 5-8 main sections (H2) for a comprehensive post | ||
| - Each section should have 3-5 key points to cover | ||
| - Target 2000-3000 total words for the post | ||
| - Include specific guidance for introduction and conclusion | ||
| """, # noqa: E501 | ||
| retries=2, | ||
| model_settings={"temperature": 0.7}, | ||
| ) | ||
|
|
||
| agent.system_prompt(add_project_details) | ||
| agent.system_prompt(add_project_pages) | ||
| agent.system_prompt(add_title_details) | ||
| agent.system_prompt(add_language_specification) | ||
| agent.system_prompt(add_target_keywords) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.