Config Object - answerrocket/answerrocket-python-client GitHub Wiki

Overview

The config object provides access to a variety of configuration-related features, including getting information about a copilot skill, updating skill chat questions, etc.

The following example creates an instance of the Max SDK, and calls the max.config.get_copilot_skill() function on the config object.

from answer_rocket import AnswerRocketClient

max = AnswerRocketClient()

max_copilot_skill = max.config.get_copilot_skill()

Functions

get_copilot()

Gets the copilot currently in context.

get_copilot(use_published_version: bool = True) -> MaxCopilot

Parameters:
  use_published_version: If True, gets the published version of the copilot (the default).  If False, gets the working version of the copilot.

Returns:  returns an instance of the MaxCopilot object.

Examples:

max_copilot = max.config.get_copilot()

get_copilot_skill()

Gets the copilot skill currently in context.

get_copilot_skill(use_published_version: bool = True) -> MaxCopilotSkill

Parameters:
  use_published_version: If True, gets the skill for the published version of the copilot (the default).  If False, gets the skill for the working version of the copilot.

Returns:  returns an instance of the MaxCopilotSkill object.

Examples:

max_copilot_skill = max.config.get_copilot_skill()

create_copilot_skill_chat_question()

Create a chat question for the current copilot skill.

create_copilot_skill_chat_question(question: str, expected_completion_response: str) -> CreateMaxCopilotSkillChatQuestionResponse

Parameters:
  question: The question to submit to GPT
  expected_completion_response: The expected completion response from GPT

Returns:  returns an instance of the CreateMaxCopilotSkillChatQuestionResponse object.

Examples:

question = "What were sales last year?"
expected_completion_response = "SELECT SUM(sales) FROM transactions WHERE {{last_year}}"

response = max.config.create_copilot_skill_chat_question(question, expected_completion_response)

print(response.copilot_skill_chat_question_id)

update_copilot_skill_chat_question()

Updates a chat question for the current copilot skill.

update_copilot_skill_chat_question(copilot_skill_chat_question_id: UUID, question: str, expected_completion_response: str) -> MaxMutationResponse

Parameters:
  copilot_skill_chat_question_id: The UUID of the chat question
  question: The question to submit to GPT
  expected_completion_response: The expected completion response from GPT

Returns:  returns an instance of the MaxMutationResponse object.

Examples:

question = "What were sales this year?"
expected_completion_response = "SELECT SUM(sales) FROM transactions WHERE {{this_year}}"

response = update_copilot_skill_chat_question(
  uuid.UUID("bc8168c4-1e5b-425a-8117-22999bca360f"),
  question, expected_completion_response)

delete_copilot_skill_chat_question()

Deletes a chat question for the current copilot skill.

delete_copilot_skill_chat_question(copilot_skill_chat_question_id: UUID) -> MaxMutationResponse

Parameters:
  copilot_skill_chat_question_id: The UUID of the chat question

Returns:  returns an instance of the MaxMutationResponse object.

Examples:

response = delete_copilot_skill_chat_question(uuid.UUID("bc8168c4-1e5b-425a-8117-22999bca360f")

create_copilot_question()

Create a chat question for the current copilot skill.

create_copilot_skill_chat_question(nl: str, skill_id: UUID | None, hint: str | None, parameters: dict | None) -> CreateMaxCopilotQuestionResponse

Parameters:
  nl: Natural language for the question
  skill_id: The ID of the skill
  hint: hint for question
  parameters: parameters for question
  

Returns:  returns an instance of the CreateMaxCopilotQuestionResponse object.

Examples:

response = max.config.create_copilot_question("Sales by month", hint="here is a hint", parameters: {"metric": "sales"})

print(response.copilot_question_id)

update_copilot_question()

Update a chat question for the current copilot skill.

update_copilot_question(question: str, expected_completion_response: str) -> MaxMutationResponse

Parameters:
  nl (str | None): Natural language for the question
  skill_id (UUID | None): The ID of the skill
  hint (str | None): hint for question
  parameters (dict | None): parameters for question
  

Returns:  returns an instance of the MaxMutationResponse object.

Examples:

response = max.config.update_copilot_question(nl="Sales by month", hint="here is a hint", parameters: {"metric": "sales"})

print(response)

delete_copilot_question()

Deletes a chat question for the current copilot skill.

delete_chat_question(copilot_question_id: UUID) -> MaxMutationResponse

Parameters:
  copilot_question_id: The UUID of the question

Returns:  returns an instance of the MaxMutationResponse object.

Examples:

response = delete_copilot_question(uuid.UUID("bc8168c4-1e5b-425a-8117-22999bca360f")