From da4767b44d658aca8e53e9a6b83790312433b1bd Mon Sep 17 00:00:00 2001 From: Joel Alexander Date: Sat, 26 Aug 2023 17:08:06 -0700 Subject: [PATCH] ready --- parea/cookbook/tracing_with_parea_sdk.py | 136 +++++++++++------------ pyproject.toml | 2 +- 2 files changed, 68 insertions(+), 70 deletions(-) diff --git a/parea/cookbook/tracing_with_parea_sdk.py b/parea/cookbook/tracing_with_parea_sdk.py index d5312d73..a3e71b16 100644 --- a/parea/cookbook/tracing_with_parea_sdk.py +++ b/parea/cookbook/tracing_with_parea_sdk.py @@ -1,5 +1,3 @@ -from typing import Tuple - import os import time from datetime import datetime @@ -275,39 +273,39 @@ def run_agent(main_objective: str, initial_task: str = "") -> tuple[list[dict[st if __name__ == "__main__": - # result = argument_chain( - # "Whether coffee is good for you.", - # additional_description="Provide a concise, few sentence argument on why coffee is good for you.", - # ) - # print(result) - # - # result2, trace_id = argument_chain2( - # "Whether wine is good for you.", - # additional_description="Provide a concise, few sentence argument on why wine is good for you.", - # ) - # time.sleep(3) - # p.record_feedback( - # FeedbackRequest( - # trace_id=trace_id, - # score=0.0, # 0.0 (bad) to 1.0 (good) - # target="Moonshine is wonderful.", - # ) - # ) - # print(result2) - # - # result3 = argument_chain3( - # "Whether moonshine is good for you.", - # additional_description="Provide a concise, few sentence argument on why moonshine is good for you.", - # ) - # time.sleep(3) - # p.record_feedback( - # FeedbackRequest( - # trace_id=result3.inference_id, - # score=0.7, # 0.0 (bad) to 1.0 (good) - # target="Moonshine is wonderful. End of story.", - # ) - # ) - # print(result3.content) + result = argument_chain( + "Whether coffee is good for you.", + additional_description="Provide a concise, few sentence argument on why coffee is good for you.", + ) + print(result) + + result2, trace_id = argument_chain2( + "Whether wine is good for you.", + additional_description="Provide a concise, few sentence argument on why wine is good for you.", + ) + time.sleep(3) + p.record_feedback( + FeedbackRequest( + trace_id=trace_id, + score=0.0, # 0.0 (bad) to 1.0 (good) + target="Moonshine is wonderful.", + ) + ) + print(result2) + + result3 = argument_chain3( + "Whether moonshine is good for you.", + additional_description="Provide a concise, few sentence argument on why moonshine is good for you.", + ) + time.sleep(3) + p.record_feedback( + FeedbackRequest( + trace_id=result3.inference_id, + score=0.7, # 0.0 (bad) to 1.0 (good) + target="Moonshine is wonderful. End of story.", + ) + ) + print(result3.content) result4, trace_id2 = run_agent("Become a machine learning expert.", "Learn about tensors.") time.sleep(3) @@ -319,37 +317,37 @@ def run_agent(main_objective: str, initial_task: str = "") -> tuple[list[dict[st ) ) print(result4) - # - # result5 = deployed_argument_chain( - # "Whether coffee is good for you.", - # additional_description="Provide a concise, few sentence argument on why coffee is good for you.", - # ) - # print(result5) - # - # result6, trace_id3 = deployed_argument_chain2( - # "Whether wine is good for you.", - # additional_description="Provide a concise, few sentence argument on why wine is good for you.", - # ) - # time.sleep(3) - # p.record_feedback( - # FeedbackRequest( - # trace_id=trace_id3, - # score=0.0, # 0.0 (bad) to 1.0 (good) - # target="Moonshine is wonderful.", - # ) - # ) - # print(result6) - # - # result7 = deployed_argument_chain3( - # "Whether moonshine is good for you.", - # additional_description="Provide a concise, few sentence argument on why moonshine is good for you.", - # ) - # time.sleep(3) - # p.record_feedback( - # FeedbackRequest( - # trace_id=result7.inference_id, - # score=0.7, # 0.0 (bad) to 1.0 (good) - # target="Moonshine is wonderful. End of story.", - # ) - # ) - # print(result7.error or result7.content) + + result5 = deployed_argument_chain( + "Whether coffee is good for you.", + additional_description="Provide a concise, few sentence argument on why coffee is good for you.", + ) + print(result5) + + result6, trace_id3 = deployed_argument_chain2( + "Whether wine is good for you.", + additional_description="Provide a concise, few sentence argument on why wine is good for you.", + ) + time.sleep(3) + p.record_feedback( + FeedbackRequest( + trace_id=trace_id3, + score=0.0, # 0.0 (bad) to 1.0 (good) + target="Moonshine is wonderful.", + ) + ) + print(result6) + + result7 = deployed_argument_chain3( + "Whether moonshine is good for you.", + additional_description="Provide a concise, few sentence argument on why moonshine is good for you.", + ) + time.sleep(3) + p.record_feedback( + FeedbackRequest( + trace_id=result7.inference_id, + score=0.7, # 0.0 (bad) to 1.0 (good) + target="Moonshine is wonderful. End of story.", + ) + ) + print(result7.error or result7.content) diff --git a/pyproject.toml b/pyproject.toml index 233ed200..ea63679a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "poetry.core.masonry.api" [tool.poetry] name = "parea-ai" packages = [{ include = "parea" }] -version = "0.1.4" +version = "0.2.0" description = "Parea python sdk" readme = "README.md" authors = ["joel-parea-ai "]