pvanand commited on
Commit
257faed
·
verified ·
1 Parent(s): 2bd73db

Update presentation_api.py

Browse files
Files changed (1) hide show
  1. presentation_api.py +20 -4
presentation_api.py CHANGED
@@ -22,14 +22,30 @@ router = APIRouter(
22
  )
23
 
24
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  @tool(parse_docstring=True)
26
- def plan(input: dict) -> str:
27
- """Input presentation plan with numbered slides and their descriptions. Returns a confirmation message indicating that the plan has been created.
 
28
 
29
  Args:
30
- input: Dictionary containing presentation details, Example: {"1": "title page for ..", "2": "introduction .."}
31
  """
32
- return f"Plan created"
33
 
34
  @tool(parse_docstring=True)
35
  def create_slide(slideno: int, content: str) -> str:
 
22
  )
23
 
24
 
25
+ from typing import Dict
26
+ from pydantic import BaseModel, Field
27
+
28
+ # First, let's create a proper input schema for the plan tool
29
+ class PlanInput(BaseModel):
30
+ input: Dict[str, str] = Field(
31
+ ..., # This makes the field required
32
+ description="Dictionary containing slide numbers as keys and descriptions as values",
33
+ example={
34
+ "1": "Title page for presentation",
35
+ "2": "Introduction section with key points",
36
+ "3": "Main content overview"
37
+ }
38
+ )
39
+
40
  @tool(parse_docstring=True)
41
+ def plan(input: PlanInput) -> str:
42
+ """Input presentation plan with numbered slides and their descriptions.
43
+ Returns a confirmation message indicating that the plan has been created.
44
 
45
  Args:
46
+ input: PlanInput object containing presentation details
47
  """
48
+ return f"Plan created with {len(input.input)} slides"
49
 
50
  @tool(parse_docstring=True)
51
  def create_slide(slideno: int, content: str) -> str: