[PAID] xAI Extension- Integrate Grok into MIT AI2

xAI Extension: Integrate Grok 2/3 Text based and Grok 2 Image Gen models!

:memo: Specifications


:package: Package: in.sarthakdev.xai
:floppy_disk: Size: 89.37 KB
:gear: Version: 1.0
:iphone: Minimum API Level: 7
:date: Updated On: 2025-05-28T18:30:00Z
:computer: Built & documented using: FAST v3.4.1
License: Sarthak's AI2 Site - license

Events:

ErrorOccurred_Event

ImageResponseReceived_Event

TextResponseReceived_Event

xAI has total 3 events.

ErrorOccurred

Triggered when an error occurs

Parameter Type
errorMessage text

ImageResponseReceived

Triggered when an image response is received

Parameter Type
imageUrl text

TextResponseReceived

Triggered when a text response is received

Parameter Type
response text

Methods:

GenerateImage_Method

GenerateText_Method

ResetChatHistory_Method

xAI has total 3 methods.

GenerateImage

Generate an image using a prompt

Parameter Type
prompt text

GenerateText

Generate text using a prompt

Parameter Type
prompt text

ResetChatHistory

Reset the chat history

Setters:

ApiKey_Set_Property
ChatHistoryEnabled_Set_Property
ImageModelName_Set_Property
MaxTokens_Set_Property
SystemMessage_Set_Property
Temperature_Set_Property
TextModelName_Set_Property

xAI has total 7 setter properties.

ApiKey

Set the xAI API Key

  • Input type: text

ChatHistoryEnabled

Enable or disable chat history

  • Input type: boolean

ImageModelName

Set the image model name

  • Input type: text
  • Helper type: ImageModelName
  • Helper enums: Grok2Image

MaxTokens

Set the maximum tokens for responses

  • Input type: number

SystemMessage

Set the system message for text generation

  • Input type: text

Temperature

Set the temperature for text generation

  • Input type: number

TextModelName

Set the text model name

  • Input type: text
  • Helper type: TextModelName
  • Helper enums: Grok3Beta, Grok3FastBeta, Grok3MiniBeta, Grok3MiniFastBeta, Grok2

Getters:

ApiKey_Get_Property
ChatHistoryEnabled_Get_Property
ImageModelName_Get_Property
MaxTokens_Get_Property
SystemMessage_Get_Property
Temperature_Get_Property
TextModelName_Get_Property

xAI has total 7 getter properties.

ApiKey

Set the xAI API Key

  • Return type: text

ChatHistoryEnabled

Enable or disable chat history

  • Return type: boolean

ImageModelName

Set the image model name

  • Return type: text

MaxTokens

Set the maximum tokens for responses

  • Return type: number

SystemMessage

Set the system message for text generation

  • Return type: text

Temperature

Set the temperature for text generation

  • Return type: number

TextModelName

Set the text model name

  • Return type: text

Purchase the Extension :sparkling_heart: (7.99$)

2 Likes

How to make the LLM remember chat history.

Just set the chathistory block to true to send the previous messages to the AI. The extension handles everything :raised_hands: