Skip to content

Conversation

@mattbit
Copy link
Member

@mattbit mattbit commented Oct 26, 2023

Few fixes and tests for the LLM scan.

  • Tested all evaluators and generators
  • Tested all detectors but prompt_injection
  • Refactored the LLM client to have a single configuration and import openai lazily
  • Fixed some issues in detectors and dependencies

@mattbit mattbit marked this pull request as ready for review October 27, 2023 17:35
@mattbit mattbit added the Lockfile Temporary label to update pdm.lock label Oct 27, 2023
@mattbit mattbit removed the Lockfile Temporary label to update pdm.lock label Oct 27, 2023
@mattbit mattbit requested a review from a team October 27, 2023 18:37
@mattbit mattbit added the Lockfile Temporary label to update pdm.lock label Oct 27, 2023
@github-actions github-actions bot removed the Lockfile Temporary label to update pdm.lock label Oct 27, 2023
@mattbit mattbit changed the title LLM scan consolidation [GSK-1978,GSK-1965] LLM scan consolidation Oct 30, 2023
@linear
Copy link

linear bot commented Oct 30, 2023

GSK-1978 Add unit tests for LLM scan

GSK-1965 Standardized config of internal LLM usage

In particular what is used in internal LLM utils llm_fn_call and similar.

Copy link
Contributor

@rabah-khalek rabah-khalek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only very minor points. Great job on the tests @mattbit!

Comment on lines +113 to +116
if out.function_call.args["passed_test"]:
results.append(EvalTestResult(score=5, reason="The answer is correct"))
else:
results.append(EvalTestResult(score=0, reason=out.function_call.args.get("reason")))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clarification: so this 3 indicates that the answer can be improved currently never happens?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code is legacy and will be removed soon.

@mattbit mattbit self-assigned this Oct 30, 2023
@mattbit mattbit merged commit 40c14aa into main Oct 30, 2023
@mattbit mattbit deleted the task/llm-scan-consolidation branch October 30, 2023 15:50
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants