You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Could we automatically fix this? (try to put all the other kwargs into the desired choice attribute)
At the least, it should reask like my schema
This is my schema:
<choice
name="action"
on-fail-choice="reask"
>
<case
name="new_file"
>
<object
name="new_file"
>
<string
name="filepath"
description="Path to the newly created file."
required="true"
/>
<string
name="description"
description="Description of the contents of the new file."
required="true"
/>
</object>
</case>
<case
name="edit_file"
>
<object
name="edit_file"
>
<string
name="filepath"
description="Path to the file to be edited."
required="true"
/>
<string
name="description"
description="Description of the changes to be made to the file."
required="true"
/>
<integer
name="start_line"
description="The line number of the first line of the hunk to be edited."
format="positive"
required="false"
on-fail="noop"
/>
<integer
name="end_line"
description="The line number of the last line of the hunk to be edited. Keep the hunk as short as possible while fulfilling the description."
format="positive"
required="false"
on-fail="noop"
/>
</object>
</case>
<case
name="finished"
>
<string
name="commit_message"
description="A more appropriate commit message based on the actions taken."
required="true"
/>
</case>
</choice>
This is the generated schema:
<output>
<string name="action" choices="new_file,edit_file,finished"/>
<object name="new_file" description="new_file" if="action==new_file">
<string name="filepath" description="Path to the newly created file." required="true"/>
<string name="description" description="Description of the contents of the new file." required="true"/>
</object>
<object name="edit_file" description="edit_file" if="action==edit_file">
<string name="filepath" description="Path to the file to be edited." required="true"/>
<string name="description" description="Description of the changes to be made to the file." required="true"/>
<integer name="start_line" description="The line number of the first line of the hunk to be edited." format="positive" required="false" on-fail="noop"/>
<integer name="end_line" description="The line number of the last line of the hunk to be edited. Keep the hunk as short as possible while fulfilling the description." format="positive" required="false" on-fail="noop"/>
</object>
<string name="finished" description="commit_message: A more appropriate commit message based on the actions taken." required="true" if="action==finished"/>
</output>
This is the generated string:
{
"action": "edit_file",
"filepath": "autopr/utils/repo.py",
"description": "Update the function call at line 124 to use the new tiktoken implementation.",
"start_line": 124,
"end_line": 124
}
This is the stack trace fragment:
File "/github/workspace/autopr/services/rail_service.py", line 56, in run_rail_object
raw_o, dict_o = pr_guard(
File "/venv/lib/python3.9/site-packages/guardrails/guard.py", line 135, in __call__
guard_history = runner(prompt_params=prompt_params)
File "/venv/lib/python3.9/site-packages/guardrails/run.py", line 86, in __call__
validated_output, reasks = self.step(
File "/venv/lib/python3.9/site-packages/guardrails/run.py", line 136, in step
validated_output = self.validate(index, output_as_dict, output_schema)
File "/venv/lib/python3.9/site-packages/guardrails/run.py", line 237, in validate
validated_output = output_schema.validate(output_as_dict)
File "/venv/lib/python3.9/site-packages/guardrails/schema.py", line 328, in validate
validated_response = self[field].validate(
File "/venv/lib/python3.9/site-packages/guardrails/datatypes.py", line 344, in validate
selected_value = schema[selected_key]
KeyError: 'edit_file'
The text was updated successfully, but these errors were encountered:
Could we automatically fix this? (try to put all the other kwargs into the desired choice attribute)
At the least, it should reask like my schema
This is my schema:
This is the generated schema:
This is the generated string:
This is the stack trace fragment:
The text was updated successfully, but these errors were encountered: