From c0d0df5d2487a8f21f75f3b0c770d76ce6ec64d7 Mon Sep 17 00:00:00 2001 From: Nicolas Nahas <45595586+nicorne@users.noreply.github.com> Date: Wed, 31 Jul 2024 14:49:27 +0200 Subject: [PATCH] improved prompt --- playground/strcutured_output/output_validator.py | 8 +++++++- .../strcutured_output/simple_structured_output.py | 11 +++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/playground/strcutured_output/output_validator.py b/playground/strcutured_output/output_validator.py index da1471f0..6bb665cc 100644 --- a/playground/strcutured_output/output_validator.py +++ b/playground/strcutured_output/output_validator.py @@ -39,7 +39,13 @@ def symbol_must_exists(symbol= str) -> str: # Initialize the schema for the person's information class StockInfo(BaseModel): """ - Describing a stock and it's infos + To create a StockInfo, you need to return a JSON object with the following format: + { + "function_call": "StockInfo", + "parameters": { + ... + } + } """ name: str = Field(..., title="Name of the company") description: str = Field(..., title="Description of the company") diff --git a/playground/strcutured_output/simple_structured_output.py b/playground/strcutured_output/simple_structured_output.py index 67c6e045..664ec08f 100644 --- a/playground/strcutured_output/simple_structured_output.py +++ b/playground/strcutured_output/simple_structured_output.py @@ -27,14 +27,17 @@ sys.path.insert(0, os.getcwd()) from pydantic import BaseModel, Field from swarms import Agent, OpenAIChat -import agentops - -agentops.start_session() # Initialize the schema for the person's information class PersonInfo(BaseModel): """ - This is a pydantic model describing the format of a structured output + To create a PersonInfo, you need to return a JSON object with the following format: + { + "function_call": "PersonInfo", + "parameters": { + ... + } + } """ name: str = Field(..., title="Name of the person") agent: int = Field(..., title="Age of the person")