mirror of
https://github.com/haiwen/seahub.git
synced 2025-05-15 03:10:13 +00:00
Support ai instruction (#7595)
* support ai instruction * update * update --------- Co-authored-by: zheng.shen <zheng.shen@seafile.com>
This commit is contained in:
parent
d4af41cbce
commit
796d2c3144
@ -324,15 +324,17 @@ class WritingAssistant(APIView):
|
||||
|
||||
text = request.data.get('text')
|
||||
writing_type = request.data.get('writing_type')
|
||||
custom_prompt = request.data.get('custom_prompt')
|
||||
|
||||
if not text:
|
||||
return api_error(status.HTTP_400_BAD_REQUEST, 'text invalid')
|
||||
if not writing_type:
|
||||
if not custom_prompt and not writing_type:
|
||||
return api_error(status.HTTP_400_BAD_REQUEST, 'writing_type invalid')
|
||||
|
||||
params = {
|
||||
'text': text,
|
||||
'writing_type': writing_type,
|
||||
'custom_prompt': custom_prompt,
|
||||
}
|
||||
|
||||
try:
|
||||
|
Loading…
Reference in New Issue
Block a user