|
6 | 6 | from dotenv import load_dotenv |
7 | 7 |
|
8 | 8 | from parea import Parea, get_current_trace_id, trace |
9 | | -from parea.schemas import Completion, CompletionResponse, LLMInputs, Message, ModelParams, Role |
| 9 | +from parea.schemas import Completion, CompletionResponse, FeedbackRequest, LLMInputs, Message, ModelParams, Role |
10 | 10 |
|
11 | 11 | load_dotenv() |
12 | 12 |
|
@@ -135,31 +135,31 @@ def json_call(): |
135 | 135 | additional_description="Provide a concise, few sentence argument on why coffee is good for you.", |
136 | 136 | ) |
137 | 137 | print(result1) |
138 | | - # |
139 | | - # result2, trace_id2 = argument_chain2( |
140 | | - # "Whether wine is good for you.", |
141 | | - # additional_description="Provide a concise, few sentence argument on why wine is good for you.", |
142 | | - # ) |
143 | | - # print(trace_id2, result2) |
144 | | - # p.record_feedback( |
145 | | - # FeedbackRequest( |
146 | | - # trace_id=trace_id2, |
147 | | - # score=0.7, # 0.0 (bad) to 1.0 (good) |
148 | | - # target="Wine is wonderful.", |
149 | | - # ) |
150 | | - # ) |
151 | | - # |
152 | | - # result3 = argument_chain3( |
153 | | - # "Whether moonshine is good for you.", |
154 | | - # additional_description="Provide a concise, few sentence argument on why moonshine is good for you.", |
155 | | - # ) |
156 | | - # print(result3.content) |
157 | | - # p.record_feedback( |
158 | | - # FeedbackRequest( |
159 | | - # trace_id=result3.inference_id, |
160 | | - # score=0.5, # 0.0 (bad) to 1.0 (good) |
161 | | - # target="Moonshine is wonderful. End of story.", |
162 | | - # ) |
163 | | - # ) |
164 | | - # |
165 | | - # print(json_call()) |
| 138 | + |
| 139 | + result2, trace_id2 = argument_chain2( |
| 140 | + "Whether wine is good for you.", |
| 141 | + additional_description="Provide a concise, few sentence argument on why wine is good for you.", |
| 142 | + ) |
| 143 | + print(trace_id2, result2) |
| 144 | + p.record_feedback( |
| 145 | + FeedbackRequest( |
| 146 | + trace_id=trace_id2, |
| 147 | + score=0.7, # 0.0 (bad) to 1.0 (good) |
| 148 | + target="Wine is wonderful.", |
| 149 | + ) |
| 150 | + ) |
| 151 | + |
| 152 | + result3 = argument_chain3( |
| 153 | + "Whether moonshine is good for you.", |
| 154 | + additional_description="Provide a concise, few sentence argument on why moonshine is good for you.", |
| 155 | + ) |
| 156 | + print(result3.content) |
| 157 | + p.record_feedback( |
| 158 | + FeedbackRequest( |
| 159 | + trace_id=result3.inference_id, |
| 160 | + score=0.5, # 0.0 (bad) to 1.0 (good) |
| 161 | + target="Moonshine is wonderful. End of story.", |
| 162 | + ) |
| 163 | + ) |
| 164 | + |
| 165 | + print(json_call()) |
0 commit comments