ChatGPT#

class recwizard.pipelines.chatgpt.configuration_chatgpt_agent.ChatgptAgentConfig(rec_pattern: str = '<movie>', resp_prompt='System:', **kwargs)[source]#

The configuration of the CRS model based on OpenAI’s GPT models.

rec_pattern#

The pattern for the potential answers.

Type:

str

resp_prompt#

The response prompt.

Type:

str

model_name#

The specified GPT model’s name.

Type:

str

prompt#

The prompt for the GPT model.

Type:

str

answer_type#

The type of the answer.

Type:

str

__init__(rec_pattern: str = '<movie>', resp_prompt='System:', **kwargs)[source]#

Initializes the instance of this configuration.

Parameters:
  • rec_pattern (str) – The pattern for the potential answers.

  • resp_prompt (str) – The response prompt.

class recwizard.pipelines.chatgpt.modeling_chatgpt_agent.ChatgptAgent(config, prompt=None, model_name=None, temperature=1, **kwargs)[source]#

The CRS model based on OpenAI’s GPT models.

model#

The GPT model.

Type:

function

prompt#

The prompt for the GPT model.

Type:

str

movie_pattern#

The pattern for the potential answers.

Type:

str

answer_type#

The type of the answer.

Type:

str

__init__(config, prompt=None, model_name=None, temperature=1, **kwargs)[source]#

Initializes the instance of this CRS model.

Parameters:
  • config (ChatgptAgentConfig) – The config file.

  • prompt (str, optional) – A prompt to override the prompt from config file.

  • model_name (str, optional) – The specified GPT model’s name.

response(query, **kwargs)[source]#

Response to the user’s input.

Parameters:

query (str) – The user’s input.

Returns:

The processed user’s input str: The response to the user’s input.

Return type:

str