GeoAIService
Injectable service wrapping the geo-ai-core engine. Available via standard NestJS dependency injection once GeoAIModule is imported.
Injection
typescript
import { Injectable } from '@nestjs/common';
import { GeoAIService } from 'geo-ai-nest';
@Injectable()
export class MyService {
constructor(private readonly geoAI: GeoAIService) {}
}Methods
| Method | Returns | Description |
|---|---|---|
generateLlms(full?, locale?) | Promise<string> | Generate llms.txt. Pass true for the full version with content, pricing, variants. |
generateRobotsTxt() | string | Generate robots.txt directives for AI crawlers. |
generateMetaTags() | string | Generate HTML meta tags for AI content discovery. |
generateLinkHeader() | string | Generate HTTP Link header pointing to llms.txt. |
generateJsonLd(resource?) | object | Generate JSON-LD structured data (Schema.org). |
isAIBot(userAgent) | string | null | Detect if a User-Agent belongs to a known AI bot. Returns bot identifier or null. |
trackCrawl(request) | Promise<void> | Log an AI bot visit (GDPR-compliant, IP anonymized via SHA-256). |
getEngine() | GeoAIInstance | Access the underlying geo-ai-core engine for advanced usage. |
invalidateCache() | Promise<void> | Clear the GEO AI cache manually. |