"""
@author: luojunhui
"""
from volcenginesdkarkruntime import Ark

from config import deep_seek_model
from config import deep_seek_default_model
from config import deep_seek_api_key_byte_dance


def fetch_deepseek_response(model, prompt):
    """
    deep_seek方法
    """
    client = Ark(
        api_key=deep_seek_api_key_byte_dance,
        timeout=1800,
        )
    response = client.chat.completions.create(
        model=deep_seek_model.get(model, deep_seek_default_model),
        messages=[
            {"role": "user", "content": prompt}
        ]
    )
    return response.choices[0].message.content