File size: 1,451 Bytes
93a5bf9
7a3f093
 
93a5bf9
7a3f093
 
 
 
 
 
 
93a5bf9
 
 
c8c0029
 
 
9f72bcf
 
93a5bf9
 
 
9f72bcf
 
 
 
 
 
7a3f093
 
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
from pydantic import BaseModel, ConfigDict , Field
from typing import  Annotated , TypedDict
from langgraph.graph.message import add_messages


class State(TypedDict):
    messages: Annotated[list, add_messages]
    response: str
    completion: bool
    interactions: list
    formatted_details: dict

# Pydantic model for extracted business info
class DetailsFormatter(BaseModel):
    '''
    Format the details from the business interaction of User and Assistant
    '''
    business_type_or_name: str = Field(description="The type or name of the business.")
    platform: str = Field(description="The platform used for the promotion of business")
    target_audience: str = Field(description="The target audience of the business")
    business_goals: str = Field(description="The business goals of the business")
    offerings: str = Field(description="The offerings of the business")
    devices_used_to_create_videos: str = Field(description="The devices used to create videos.")
    Challenges_faced: str = Field(description="The challenges faced by the business")
    additional_informations: str = Field(description="Additional queries or details regarding the video or idea creation.")


class ConversationFormatter(BaseModel):
    response: str= Field(description="The entire response of the assistant.")
    completion: bool=Field(description=''''Return 'True' if the details extraction is completed. Return 'False' if not completed.''')