XAI Grok
The XAI Grok connector enables users to query an AI model for intelligent, explainable responses directly within their security automation workflows.
XAI Grok serves as an advanced AI platform, offering model-based responses to complex queries and facilitating deep data analysis. Through the XAI Grok connector, Swimlane Turbine users can harness the power of AI to generate insights, automate reasoning tasks, and customize searches within their security workflows. This integration empowers security teams to make informed decisions faster, streamline data analysis, and tailor information retrieval to their unique requirements, all within the low-code Swimlane Turbine environment.
Limitations
None to date.
Supported Versions
This connector supports the latest version of XAI Grok.
Prerequisites
To effectively utilize the XAI Grok connector within Swimlane Turbine, ensure you have the following:
- API Key Authentication with the necessary parameters:
- URL: The endpoint address for XAI Grok's API services.
- API Key: A unique identifier to authenticate requests to XAI Grok.
- Model: The specific AI model within XAI Grok to be used for generating responses.
Capabilities
This Connector provides the following capabilities:
- Ask Grok
Ask Grok
Generates output using the selected Grok model and the input text.
XAI Grok's documentation for this action can be found here here.
Configurations
API Key Authentication
Authenticates using an API Key
Configuration Parameters
Parameter | Description | Type | Required |
|---|---|---|---|
url | The URL of the XAI Grok API. | string | Required |
apiKey | Your unique API key for authentication. | string | Required |
model | The model that will complete your prompt. | string | Required |
verify_ssl | Verify SSL certificate | boolean | Optional |
http_proxy | A proxy to route requests through. | string | Optional |
Actions
Ask Grok
Generates a model-based response from XAI Grok using the provided input prompt.
Endpoint
- URL: /v1/chat/completions
- Method: POST
Input
Argument Name | Type | Required | Description |
|---|---|---|---|
prompt | string | Required | The prompt to send to the model. |
deferred | boolean | Optional | Whether to defer the response or not. |
frequency_penalty | number | Optional | How much to penalize new tokens based on their existing frequency in the text so far. |
logit_bias | object | Optional | The logit bias to apply to the response. |
logprobs | boolean | Optional | Whether to return log probabilities of the output tokens or not. |
max_completion_tokens | number | Optional | The maximum number of tokens to generate. |
n | number | Optional | How many chat completion choices to generate for each input message. |
parallel_tool_calls | boolean | Optional | Whether to allow parallel tool calls or not. |
presence_penalty | number | Optional | How much to penalize new tokens based on their existing presence in the text so far. |
reasoning_effort | string | Optional | The effort to use for reasoning. |
search_parameters | array | Optional | Set the parameters to be used for searched data. |
search_parameters.from_date | string | Optional | Date from which to consider the results in ISO-8601 YYYY-MM-DD. |
search_parameters.to_date | string | Optional | Date up to which to consider the results in ISO-8601 YYYY-MM-DD. |
search_parameters.max_search_results | number | Optional | Maximum number of search results to use. |
search_parameters.mode | string | Optional | Mode to use for searching data. |
search_parameters.return_citations | boolean | Optional | Whether to return citations in the response or not. |
search_parameters.sources | array | Required | Parameters for the Ask Grok action |
search_parameters.sources.excluded_x_handles | array | Optional | List of X handles to exclude from the search results. |
search_parameters.sources.included_x_handles | array | Optional | List of X handles to include in the search results. |
search_parameters.sources.post_favorite_count | number | Optional | The minimum favorite count of the X posts to consider. |
search_parameters.sources.post_view_count | number | Optional | The minimum view count of the X posts to consider. |
search_parameters.sources.type | string | Required | Type of the data to search. |
search_parameters.sources.allowed_websites | array | Optional | List of website to allow in the search results. |
search_parameters.sources.excluded_websites | array | Optional | List of website to exclude from the search results without protocol specification or subdomains. |
search_parameters.sources.country | string | Optional | ISO alpha-2 code of the country. |
Input Example
{"json_body":{"deferred":false,"frequency_penalty":2,"logit_bias":{},"logprobs":false,"max_completion_tokens":100,"n":1,"parallel_tool_calls":true,"presence_penalty":0,"reasoning_effort":"low","search_parameters":[{"from_date":"2012-01-01","to_date":"2025-01-01","max_search_results":15,"mode":"auto","return_citations":true,"sources":[{"excluded_x_handles":["elonmusk"],"included_x_handles":["jack"],"post_favorite_count":100,"post_view_count":1000,"type":"x","allowed_websites":["swimlane.com"],"excluded_websites":["google.com"],"country":"US","safe_search":true,"links":["https://swimlane.com"]}]}],"seed":10,"stop":["test"],"stream":false,"stream_options":[{"include_usage":false}],"temperature":0,"tool_choice":[{"function":[{"name":"my_function"}],"type":"function"}],"tools":[{"type":"function","function":{"name":"get_current_weather","description":"Get the current weather in a given location","parameters":{},"strict":true},"sources":[{"excluded_x_handles":["elonmusk"],"included_x_handles":["jack"],"post_favorite_count":100,"post_view_count":1000,"type":"x","allowed_websites":["swimlane.com"],"excluded_websites":["google.com"],"country":"US","safe_search":true,"links":["https://swimlane.com"]}]}],"top_logprobs":0,"top_p":1,"user":"user_123","web_search_options":[{"filters":["news","videos"],"search_context_size":"max_search","user_location":"New York, NY"}]},"prompt":"What is the capital of France?"}
Output
Parameter | Type | Description |
|---|---|---|
message | string | Response message |
status_code | number | HTTP status code of the response |
reason | string | Response reason phrase |
Output Example
{"message":"Paris is the capital and most populous city of France. \nSituated on the Seine Ri...","status_code":200,"headers":null,"reason":"OK"}
Response Headers
Header | Description | Example |
|---|---|---|
Content-Type | The media type of the resource | application/json |
Date | The date and time at which the message was originated | Thu, 01 Jan 2024 00:00:00 GMT |