File size: 2,769 Bytes
3a3fe92
9f72bcf
3a3fe92
 
 
 
9f72bcf
3002e1b
9f72bcf
46178b9
9f72bcf
3002e1b
 
9f72bcf
11bd168
9f72bcf
 
11bd168
9f72bcf
 
 
3a3fe92
 
9acd478
3a3fe92
c636895
 
b623e6c
 
 
 
 
9acd478
 
 
b623e6c
f054586
 
 
 
 
 
 
b623e6c
9f72bcf
 
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
from pydantic import BaseModel, Field
from typing import Optional , List
import operator
from typing import Annotated

class State(BaseModel):
    business_details : Annotated[list[dict],operator.add] = []
    scores: Annotated[list[dict],operator.add] = []
    influencers_data : Annotated[list[str],operator.add] = []
    imdb_data : Annotated[list[str],operator.add] = []
    ideator_response: Annotated[list[str],operator.add] = []
    moderator_response: Annotated[list[str],operator.add] = []
    simplifier_response: Annotated[list[str],operator.add] = []
    critic_response:  Annotated[list[str],operator.add] = []
    normalizer_response : Annotated[list[dict],operator.add] = []
    judge1_response : Annotated[list[dict],operator.add] = []
    judge2_response : Annotated[list[dict],operator.add] = []
    unique_selected_ideas : Annotated[list[dict],operator.add] = []
    validator_response: Annotated[list[str],operator.add] = []
    disagreement_reason: Annotated[list[str],operator.add] = []
    image_caption: Annotated[list[str],operator.add] = []

class QueryFormatter(BaseModel):
    business_details: str = Field(description="The details of the business that user passes to the agent")

class ImproverResponseFormatter(BaseModel):
   faults: str= Field(description="Returns the faults of the critic's response if any.")
   improved_idea1: str = Field(description="Returns the first improved idea of exactly 40 words. If no faults found, repeat the critic's version.")
   improved_idea2: str = Field(description="Returns the second improved idea of exactly 40 words. If no faults found, repeat the critic's version.")
   improved_idea3: str = Field(description="Returns the third improved idea of exactly 40 words. If no faults found, repeat the critic's version.")
   improved_idea4: str = Field(description="Returns the fourth improved idea of exactly 40 words. If no faults found, repeat the critic's version.")

class ValidationFormatter(BaseModel):
  result: str = Field(description="Returns **validated** if the idea is validated. Returns **not validated** if story is not validated.")
  reason: str = Field(description="If the idea is **not validated**, it returns the reason why it is not validated.")

class CriticResponseFormatter(BaseModel):
   faults: str= Field(description="Returns the faults in the critic's response if any.")
   improved_idea1: str = Field(description="Returns the first improved idea of exactly 40 words. ")
   improved_idea2: str = Field(description="Returns the second improved idea of exactly 40 words. ")
   improved_idea3: str = Field(description="Returns the third improved idea of exactly 40 words. ")
   improved_idea4: str = Field(description="Returns the fourth improved idea of exactly 40 words. ")