Skip to content

Repository files navigation

llmpulse

LLMPulse - the Ruby gem for the LLM Pulse API

REST API client for LLM Pulse AI visibility analytics.

This SDK is automatically generated by the OpenAPI Generator project:

  • API version: 1.22.0
  • Package version: 1.22.0
  • Generator version: 7.24.0
  • Build package: org.openapitools.codegen.languages.RubyClientCodegen For more information, please visit https://llmpulse.ai

Installation

Build a gem

To build the Ruby code into a gem:

gem build llmpulse.gemspec

Then either install the gem locally:

gem install ./llmpulse-1.22.0.gem

(for development, run gem install --dev ./llmpulse-1.22.0.gem to install the development dependencies)

or publish the gem to a gem hosting service, e.g. RubyGems.

Finally add this to the Gemfile:

gem 'llmpulse', '~> 1.22.0'

Install from Git

If the Ruby gem is hosted at a git repository: https://github.com/LLM-Pulse/llmpulse-ruby, then add the following in the Gemfile:

gem 'llmpulse', :git => 'https://github.com/LLM-Pulse/llmpulse-ruby.git'

Include the Ruby code directly

Include the Ruby code directly using -I as follows:

ruby -Ilib script.rb

Getting Started

Please follow the installation procedure and then run the following code:

# Load the gem
require 'llmpulse'

# Setup authorization
LLMPulse.configure do |config|
  # Configure Bearer authorization: BearerAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
  # Configure a proc to get access tokens in lieu of the static access_token configuration
  config.access_token_getter = -> { 'YOUR TOKEN GETTER PROC' } 
  # Configure faraday connection
  config.configure_faraday_connection { |connection| 'YOUR CONNECTION CONFIG PROC' }
end

api_instance = LLMPulse::AIModelInsightsApi.new
project_id = 56 # Integer | Project ID
opts = {
  range: 56, # Integer | Number of days to look back (alternative to from/to)
  from: Time.parse('2013-10-20T19:20:30+01:00'), # Time | 
  to: Time.parse('2013-10-20T19:20:30+01:00'), # Time | 
  granularity: 'day', # String | 
  collection_id: 56, # Integer | 
  country_code: 'country_code_example', # String | ISO country code (e.g. US, GB, DE)
  language_code: 'language_code_example', # String | ISO language code (e.g. en, es, de)
  prompt_type: 'informational', # String | Filter by prompt type (search intent)
  brand_kind: 'brand', # String | Filter by brand kind: brand (own brand/products), brand_other (competitors/other brands), non_brand (generic, no brand named). For fair 1:1 brand-vs-competitor comparisons (visibility, share of voice), use non_brand: brand-focused prompts skew results toward the brand they name. The in-app Overview page applies non_brand by default.
  competitors: 'competitors_example' # String | Comma-separated competitor IDs (unknown IDs return ERR_INVALID_PARAM)
}

begin
  #AI Model Insights summary
  api_instance.get_ai_model_insights_summary(project_id, opts)
rescue LLMPulse::ApiError => e
  puts "Exception when calling AIModelInsightsApi->get_ai_model_insights_summary: #{e}"
end

Documentation for API Endpoints

All URIs are relative to https://api.llmpulse.ai/api/v1

Class Method HTTP request Description
LLMPulse::AIModelInsightsApi get_ai_model_insights_summary GET /reports/ai_model_insights/summary AI Model Insights summary
LLMPulse::AIModelInsightsApi get_ai_model_position_distribution GET /reports/ai_model_insights/position_distribution Position distribution comparison
LLMPulse::AIModelInsightsApi get_ai_overview_results GET /reports/ai_model_insights/ai_overview_results Google AI Overview result availability
LLMPulse::AnnotationsApi create_annotation POST /annotations Create a timeline annotation
LLMPulse::AnnotationsApi delete_annotation DELETE /annotations/{id} Delete a timeline annotation
LLMPulse::AnnotationsApi list_annotations GET /annotations List timeline annotations
LLMPulse::AnnotationsApi update_annotation PATCH /annotations/{id} Update a timeline annotation
LLMPulse::AnswersApi get_answer GET /answers/{id} Get one AI response
LLMPulse::AnswersApi list_answers GET /answers List AI responses
LLMPulse::CitationIntelligenceApi get_cited_url_content GET /citation_intelligence/urls/{url_sha256}/content Cited URL cached content
LLMPulse::CitationIntelligenceApi get_cited_url_detail GET /citation_intelligence/urls/{url_sha256} Cited URL detail
LLMPulse::CitationIntelligenceApi get_mentions_by_citing_domain GET /citation_intelligence/mentions_by_domain Mention share by citing domain
LLMPulse::CitationIntelligenceApi list_citation_groups GET /citation_intelligence/groups Grouped citation intelligence
LLMPulse::CitationIntelligenceApi list_cited_url_occurrences GET /citation_intelligence/urls/{url_sha256}/occurrences Cited URL occurrences
LLMPulse::CollectionsApi create_collection POST /collections Create a tag
LLMPulse::CollectionsApi delete_collection DELETE /collections/{id} Delete a tag
LLMPulse::CollectionsApi update_collection PATCH /collections/{id} Update a tag
LLMPulse::CompetitorsApi create_competitor POST /competitors Add a competitor
LLMPulse::CompetitorsApi delete_competitor DELETE /competitors/{id} Delete a competitor
LLMPulse::CompetitorsApi update_competitor PATCH /competitors/{id} Update a competitor
LLMPulse::DimensionsApi get_competitor_details GET /dimensions/competitors/{id} Competitor details
LLMPulse::DimensionsApi get_project_details GET /dimensions/projects/{id} Project details
LLMPulse::DimensionsApi list_agent_bots GET /dimensions/agent_bots AI bot catalog (Scale+)
LLMPulse::DimensionsApi list_all_citations GET /dimensions/all_citations List all citations (brand + competitor)
LLMPulse::DimensionsApi list_all_mentions GET /dimensions/all_mentions List all mentions (brand + competitor)
LLMPulse::DimensionsApi list_citations GET /dimensions/citations List brand citations
LLMPulse::DimensionsApi list_collections GET /dimensions/collections List tags/collections
LLMPulse::DimensionsApi list_competitor_citations GET /dimensions/competitor_citations List competitor citations
LLMPulse::DimensionsApi list_competitor_mentions GET /dimensions/competitor_mentions List competitor mentions
LLMPulse::DimensionsApi list_competitors GET /dimensions/competitors List competitors
LLMPulse::DimensionsApi list_locales GET /dimensions/locales List locales with data
LLMPulse::DimensionsApi list_mentions GET /dimensions/mentions List brand mentions
LLMPulse::DimensionsApi list_models GET /dimensions/models List models with data
LLMPulse::DimensionsApi list_projects GET /dimensions/projects List projects
LLMPulse::DimensionsApi list_prompt_executions GET /dimensions/prompt_executions List prompt executions
LLMPulse::DimensionsApi list_prompts GET /dimensions/prompts List prompts
LLMPulse::DimensionsApi list_sentiment_categories GET /dimensions/sentiments List sentiment categories
LLMPulse::DimensionsApi list_sources GET /dimensions/sources List source URLs
LLMPulse::DimensionsApi list_tags GET /dimensions/tags List tags (alias for /collections)
LLMPulse::GEOWriterApi create_intelligence_task POST /intelligence_tasks Create a GEO Writer task
LLMPulse::GEOWriterApi get_intelligence_task GET /intelligence_tasks/{id} Get a GEO Writer task
LLMPulse::GEOWriterApi list_intelligence_tasks GET /intelligence_tasks List GEO Writer tasks
LLMPulse::HealthApi ping GET /ping Health check
LLMPulse::MetricsApi get_agent_traffic GET /metrics/agent_traffic AI bot crawler traffic (Scale+, Beta)
LLMPulse::MetricsApi get_ai_traffic GET /metrics/ai_traffic AI referral traffic (Scale+)
LLMPulse::MetricsApi get_prompt_summary GET /metrics/prompt_summary Per-prompt metrics summary
LLMPulse::MetricsApi get_share_of_voice GET /metrics/sov Share of Voice
LLMPulse::MetricsApi get_summary GET /metrics/summary Aggregated metrics summary
LLMPulse::MetricsApi get_timeseries GET /metrics/timeseries Time-series metrics
LLMPulse::MetricsApi get_top_sources GET /metrics/top_sources Top cited sources
LLMPulse::ProjectsApi create_project POST /projects Create a project (fast mode)
LLMPulse::ProjectsApi create_project_draft POST /project_drafts Start a project draft (wizard step 1)
LLMPulse::ProjectsApi finalize_project_draft POST /project_drafts/{id}/finalize Finalize a draft into a real project
LLMPulse::ProjectsApi get_project_draft GET /project_drafts/{id} Read a project draft
LLMPulse::ProjectsApi update_project_draft PATCH /project_drafts/{id} Submit a wizard step
LLMPulse::PromptsApi assign_prompt_tags POST /prompts/assign_tags Bulk-attach tags to prompts
LLMPulse::PromptsApi create_prompts POST /prompts Bulk-create prompts
LLMPulse::PromptsApi delete_prompt DELETE /prompts/{id} Delete a prompt
LLMPulse::RecommendationsApi get_recommendation GET /recommendations/{id} Get recommendation run with items
LLMPulse::RecommendationsApi launch_recommendations POST /recommendations Launch a recommendations generation
LLMPulse::RecommendationsApi list_recommendations GET /recommendations List recommendation runs
LLMPulse::ReportsApi create_technical_geo_reports POST /technical_geo_reports Run technical GEO analysis
LLMPulse::SearchConsoleApi get_search_console_pages GET /search_console/pages Top Search Console pages (Growth+)
LLMPulse::SearchConsoleApi get_search_console_queries GET /search_console/queries Top Search Console queries (Growth+)
LLMPulse::SearchConsoleApi get_search_console_summary GET /search_console/summary Search Console summary (Growth+)
LLMPulse::SearchConsoleApi get_search_console_timeseries GET /search_console/timeseries Search Console time series (Growth+)
LLMPulse::SentimentsApi list_sentiment_records GET /sentiments List sentiment records
LLMPulse::WebhooksApi create_webhook POST /webhooks Create a webhook subscription
LLMPulse::WebhooksApi delete_webhook DELETE /webhooks/{id} Delete a webhook subscription
LLMPulse::WebhooksApi list_webhooks GET /webhooks List webhook subscriptions
LLMPulse::WebhooksApi sample_webhook_payloads GET /webhooks/sample/{event_type} Sample event payloads

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

BearerAuth

  • Type: Bearer authentication

About

Official Ruby SDK for the LLM Pulse REST API

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages