You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constformatterAgent=createReactAgent({
llm,tools: [],messageModifier: newSystemMessage("You are markdown formatter agent, using all the content provide from the blogger and image generator, there needs to be a main image of the blog ensure you place that before the first heading. Complie everything into a final output that can be displayed with headings and paragraphs and images in markdown styling. Respond with JSON object {{markdown:..., image:..., meta:...}}"),});constformatterNode=async(state: typeofAgentState.State,config?: RunnableConfig)=>{formatterAgent;constresult=awaitformatterAgent.invoke(state,config);constlastMessage=result.messages[result.messages.length-1];return{messages: [newHumanMessage({content: lastMessage.content,name: "formatter"}),],};};
constblogSchema=z.object({markdown: z.string().describe("The main content of the blog in markdown"),image: z.string().describe("The image url of the blog"),meta: z.object({description: z.string().describe("The meta description of the blog"),tags: z.array(z.string()).describe("Tags related to the blog"),}),});
I have this as part of my supervisor workflow, however I want to use a structured output using Zod, like above. Is there a way to use strucuturedOutput with this flow because i keep getting errors no matter how I try to incorporate it.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I have this as part of my supervisor workflow, however I want to use a structured output using Zod, like above. Is there a way to use strucuturedOutput with this flow because i keep getting errors no matter how I try to incorporate it.
Beta Was this translation helpful? Give feedback.
All reactions