-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simulator using structured outputs for conversation and conversation ID #39337
Simulator using structured outputs for conversation and conversation ID #39337
Conversation
remove required keys
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.
Files not reviewed (1)
- sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/simulator/_adversarial_simulator.py: Evaluated as low risk
Comments suppressed due to low confidence (5)
sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/simulator/_conversation/init.py:129
- Remove commented-out print statements to keep the code clean.
print(self.persona_template_args)
sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/simulator/_conversation/init.py:135
- Remove commented-out print statements to keep the code clean.
print(f"Conversation starter content: {conversation_starter_content}")
sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/simulator/_conversation/init.py:140
- Remove commented-out print statements to keep the code clean.
print("Successfully created a Jinja2 template for the conversation starter.")
sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/simulator/_conversation/init.py:141
- Remove commented-out print statements to keep the code clean.
print(f"Template syntax error: {e}. Using raw content.")
sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/simulator/_conversation/_conversation.py:177
- [nitpick] The logger warning message could be more descriptive.
logger.warning("Error: %s", str(e))
turn_number=0, | ||
conversation_id=conversation_id, | ||
) | ||
except Exception: # pylint: disable=broad-except |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid using broad exception handling. Handle specific exceptions instead.
except Exception: # pylint: disable=broad-except | |
except SomeSpecificException: # Replace SomeSpecificException with the actual exception type |
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
max_history=history_limit, | ||
turn_number=current_turn, | ||
) | ||
except Exception: # pylint: disable=broad-except |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid using broad exception handling. Handle specific exceptions instead.
except Exception: # pylint: disable=broad-except | |
except (TimeoutError, ValueError): # pylint: disable=broad-except |
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
API change check API changes are not detected in this pull request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 5 out of 8 changed files in this pull request and generated 1 comment.
Files not reviewed (3)
- sdk/evaluation/azure-ai-evaluation/tests/unittests/test_synthetic_conversation_bot.py: Evaluated as low risk
- sdk/evaluation/azure-ai-evaluation/CHANGELOG.md: Evaluated as low risk
- sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/simulator/_conversation/init.py: Evaluated as low risk
Comments suppressed due to low confidence (1)
sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/simulator/_model_tools/models.py:618
- Returning a hardcoded "id": "unknown" could lead to confusion when debugging or tracking conversations. Consider logging a warning or raising an exception if the id is not found in the response data.
return {"samples": [response_data], "finish_reason": ["completed"], "id": "unknown"}
@@ -350,6 +357,7 @@ def _setup_bot( | |||
parameters: TemplateParameters, | |||
target: Optional[Callable] = None, | |||
scenario: Union[AdversarialScenario, AdversarialScenarioJailbreak], | |||
conversation_id: Optional[str] = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parameter 'conversation_id' is added but not used in the '_setup_bot' method. It should be either removed or utilized properly.
conversation_id: Optional[str] = None, | |
scenario: Union[AdversarialScenario, AdversarialScenarioJailbreak], |
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
Description
Please add an informative description that covers that changes made by the pull request and link all relevant issues.
If an SDK is being regenerated based on a new swagger spec, a link to the pull request containing these swagger spec changes has been included above.
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines