Skip to content

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tssweeney committed Nov 7, 2024
1 parent cf81ef1 commit 3e8aa1e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions weave/trace_server/actions_worker/actions/llm_judge.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ def do_llm_judge_action(
completion = trace_server.completions_create(
CompletionsCreateReq(
project_id=project_id,
inputs=dict(
model=model,
messages=[
inputs={
"model": model,
"messages": [
{"role": "system", "content": system_prompt},
{"role": "user", "content": json.dumps(args)},
],
response_format=response_format,
),
"response_format": response_format,
},
track_llm_call=False,
)
)
Expand Down
6 changes: 3 additions & 3 deletions weave/trace_server/actions_worker/dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ def execute_batch(
# 1. Lookup the action definition
parsed_ref = parse_internal_uri(batch_req.action_ref)
if parsed_ref.project_id != project_id:
raise ValueError(
raise TypeError(
f"Action ref {batch_req.action_ref} does not match project_id {project_id}"
)
if not isinstance(parsed_ref, InternalObjectRef):
raise ValueError(f"Action ref {batch_req.action_ref} is not an object ref")
raise TypeError(f"Action ref {batch_req.action_ref} is not an object ref")

action_def_read = trace_server.obj_read(
ObjReadReq(
Expand Down Expand Up @@ -124,7 +124,7 @@ def publish_results_as_feedback(
weave_ref = InternalCallRef(project_id, call_id).uri()
parsed_action_ref = parse_internal_uri(action_ref)
if not isinstance(parsed_action_ref, (InternalObjectRef, InternalOpRef)):
raise ValueError(f"Invalid action ref: {action_ref}")
raise TypeError(f"Invalid action ref: {action_ref}")
action_name = parsed_action_ref.name
return trace_server.feedback_create(
FeedbackCreateReq(
Expand Down

0 comments on commit 3e8aa1e

Please sign in to comment.