Skip to content

Commit

Permalink
ready
Browse files Browse the repository at this point in the history
  • Loading branch information
jalexanderII committed Aug 27, 2023
1 parent 40e04b8 commit da4767b
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 70 deletions.
136 changes: 67 additions & 69 deletions parea/cookbook/tracing_with_parea_sdk.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from typing import Tuple

import os
import time
from datetime import datetime
Expand Down Expand Up @@ -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)
Expand All @@ -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)
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>"]
Expand Down

0 comments on commit da4767b

Please sign in to comment.