Skip to content
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

Be able to select language for Ai text generation (#7299) #8432

Merged
merged 12 commits into from
Sep 24, 2024

Conversation

frapuks
Copy link
Member

@frapuks frapuks commented Sep 20, 2024

Proposed changes

  • New language field in ask ai form in Report
  • Using this language in prompt
  • Manage the default value
  • Create a dedicated languages list for future implemetation of ai languages
  • Add platform_language in RootSettingsFragment
  • Manage the forgotten translation in the ask ai form

Related issues

Checklist

  • I consider the submitted work as finished
  • I tested the code for its functionality
  • I wrote test cases for the relevant uses case (coverage and e2e)
  • I added/update the relevant documentation (either on github or on notion)
  • Where necessary I refactored code to improve the overall quality

Comments

Default value (in order) : user language, platform language, locale language
Locale language is the browser language if it's supported by OpenCTI (1 of 7 supported language), or English.

@frapuks frapuks added the filigran team use to identify PR from the Filigran team label Sep 20, 2024
@frapuks frapuks self-assigned this Sep 20, 2024
@frapuks frapuks changed the title Be able to select language for Ai text generation Be able to select language for Ai text generation (#7299) Sep 20, 2024
Copy link

codecov bot commented Sep 20, 2024

Codecov Report

Attention: Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.

Project coverage is 66.97%. Comparing base (7f62490) to head (d1fdab4).
Report is 9 commits behind head on release/6.4.0.

Files with missing lines Patch % Lines
...atform/opencti-graphql/src/modules/ai/ai-domain.ts 0.00% 4 Missing ⚠️
...ti-platform/opencti-graphql/src/database/ai-llm.ts 0.00% 2 Missing ⚠️
Additional details and impacted files
@@                Coverage Diff                @@
##           release/6.4.0    #8432      +/-   ##
=================================================
+ Coverage          66.19%   66.97%   +0.77%     
=================================================
  Files                597      597              
  Lines              60387    60431      +44     
  Branches            6193     6670     +477     
=================================================
+ Hits               39974    40472     +498     
+ Misses             20413    19959     -454     
Flag Coverage Δ
66.97% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@frapuks frapuks marked this pull request as ready for review September 23, 2024 06:02
Archidoit
Archidoit previously approved these changes Sep 23, 2024
@Archidoit Archidoit added the do not merge Do not merge this PR until this tag will be removed label Sep 23, 2024
@Archidoit
Copy link
Member

(To be merged in the dev branch)

@Archidoit
Copy link
Member

In japanese, some words are not translated:
image

@Archidoit Archidoit dismissed their stale review September 23, 2024 09:01

strange behavior in japanese

@Archidoit
Copy link
Member

Archidoit commented Sep 23, 2024

All the translations appear in the backend log :
image

@frapuks frapuks marked this pull request as draft September 23, 2024 09:18
@frapuks frapuks changed the base branch from master to release/6.4.0 September 23, 2024 09:24
@frapuks frapuks removed the do not merge Do not merge this PR until this tag will be removed label Sep 23, 2024
@frapuks
Copy link
Member Author

frapuks commented Sep 23, 2024

Finally, it works better with English name of languages in the prompt : - The report should be in German language. in place of - The report should be in de-de language.

@frapuks frapuks marked this pull request as ready for review September 23, 2024 14:23
@Archidoit
Copy link
Member

@frapuks It's indeed better but still not fully translated :
image

@frapuks frapuks merged commit 87eae7e into release/6.4.0 Sep 24, 2024
5 checks passed
@frapuks frapuks deleted the issue/7299 branch September 24, 2024 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
filigran team use to identify PR from the Filigran team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When using AI, to generate text, be able to select the language and pre-fill with the user profile lang
2 participants