Python:
def _async_func(this_cls):
input_text = this_cls.input_text
data = {
"model": "deepseek-chat",
"messages": [{"role": "user", "content": input_text}],
"max_tokens": 50 # Limit response length
}
try:
response = this_cls.call_deepseek_api(data)
this_cls._result = response
except Exception as e:
this_cls._result = f"Error calling Deepseek API: {str(e)}"