"DeepSeek" (Service Connection)

This service connection requires an external account »

Use the DeepSeek API with the Wolfram Language.

Connecting & Authenticating

ServiceConnect["DeepSeek"] creates a connection to the DeepSeek API. If a previously saved connection can be found, it will be used; otherwise, a new authentication request will be launched.
Use of this connection requires internet access and a DeepSeek account.

Requests

ServiceExecute["DeepSeek","request",params] sends a request to the DeepSeek API, using parameters params. The following gives possible requests.
Request:

"TestConnection" returns Success for working connection, Failure otherwise

Text

Request:

"Chat" create a response for the given chat conversation

Parameters:
  • "Messages"(required)a list of messages in the conversation, each given as an association with "Role" and "Content" keys
    "FrequencyPenalty"Automaticpenalize tokens based on their existing frequency in the text so far
    "MaxTokens"Automaticmaximum number of tokens to generate
    "Model"Automaticname of the model to use
    "N"Automaticnumber of chat completions to return
    "PresencePenalty"Automaticpenalize new tokens based on whether they appear in the text so far
    "StopTokens"Automaticstrings where the API will stop generating further tokens
    "Stream"Falsereturn the result as server-sent events
    "Temperature"Automaticsampling temperature
    "TotalProbabilityCutoff"Automatican alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with the requested probability mass
  • Model Lists

    Request:

    "ChatModelList" list models available for the "Chat" request

    Examples

    open allclose all

    Basic Examples  (1)

    Create a new connection:

    Generate a response from a chat:

    Scope  (3)

    Connection  (1)

    Test the connection:

    Text  (2)

    Chat  (1)

    Respond to a chat containing multiple messages:

    ChatModelList  (1)

    Look up the available chat models list: