File size: 696 Bytes
59d7151
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36b4c92
59d7151
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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2024/6/27 下午5:24
# @Author  : Tim-Saijun https://zair.top
# @File    : graph_base.py
# @Project : SAgent
from typing import List, Annotated, TypedDict

from langchain_core.pydantic_v1 import BaseModel, Field
from langgraph.graph.message import add_messages


class GraphState(TypedDict):
    abstract: str
    input: str
    messages: Annotated[list, add_messages]
    plan: List[str]
    time: int
    result: list[str]


class Plan(BaseModel):
    steps: List[str] = Field(
        description="Each element string contains the secondary title and theme, the tertiary title and theme, and the SEO word distribution strategy"
    )