Spaces:
Runtime error
Runtime error
File size: 998 Bytes
dac7fdc |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
import os
import openai
from typing import Dict, List, Optional
from pydantic import BaseModel, Field, SecretStr
from utils.summarizer import get_analyze_result
from workcell.integrations.types import MarkdownMixin
class Input(BaseModel):
keywords: List[str] = Field(default=["backend development", "micro services", 'dev-ops', 'OKR'], max_items=20,
description="List of keyword to describe your work this week.")
openai_api_key: Optional[SecretStr] = Field(
..., description="OpenAI API key, provide if you have, or use our default key (may reach tier limit)."
)
def generate_weekly_report(input: Input) -> MarkdownMixin:
"""Returns a weekly report by several keywords, generated by OpenAI GPT3 API."""
openai.api_key = os.getenv('SECRET_OPENAI_WORKCELL_WEBPAGE_QA')
# return summarization
text = input.keywords
analyze = get_analyze_result(text)
output = MarkdownMixin(
data = analyze
)
return output |