add: worksop entry & end date for events/workshops & summary change

This commit is contained in:
2026-07-26 14:17:11 +01:00
parent 5b434abd06
commit ce91ff46e0
11 changed files with 189 additions and 29 deletions

View File

@@ -4,9 +4,9 @@ from pydantic_ai.providers.ollama import OllamaProvider
from dotenv import load_dotenv
import os
import json
from prompts import OPPORTUNITY_PROMPT, EVENT_PROMPT
from prompts import OPPORTUNITY_PROMPT, EVENT_PROMPT, WORKSHOP_PROMPT
load_dotenv()
load_dotenv(override=True)
ollama_url = os.getenv("OLLAMA_BASE_URL")
@@ -34,6 +34,14 @@ event_agent = Agent(
retries=5
)
# --- WORKSHOP AGENT ---
workshop_agent = Agent(
model,
output_type=str,
system_prompt=WORKSHOP_PROMPT,
retries=5
)
async def parse_page(content: str, entry_type: str = "opportunity"):
"""
Parse content and extract entry data based on type.
@@ -43,7 +51,12 @@ async def parse_page(content: str, entry_type: str = "opportunity"):
entry_type: Either 'opportunity' or 'event'
"""
# Select the appropriate agent
agent = opportunity_agent if entry_type == "opportunity" else event_agent
if entry_type == "opportunity":
agent = opportunity_agent
elif entry_type == "event":
agent = event_agent
else:
agent = workshop_agent
# 1. Run the agent (which returns a string)
print(f"[DEBUG] Generating {entry_type}...")