Built-in Providers

Nest includes built-in providers for:

  • Solana RPC

  • OpenAI

  • Custom API integrations

These providers enable agents to connect to data sources, process information, and interact with blockchain or AI models efficiently.

Code Example:

import { Injectable } from '@nestjs/common';
import { SolanaProvider } from './providers/solana.provider';
import { OpenAIProvider } from './providers/openai.provider';
import { CustomAPIProvider } from './providers/custom-api.provider';

@Injectable()
export class DataService {
  constructor(
    private solanaProvider: SolanaProvider,
    private openAIProvider: OpenAIProvider,
    private customAPIProvider: CustomAPIProvider,
  ) {}

  async connectToSolana() {
    return await this.solanaProvider.connect();
  }

  async fetchFromOpenAI(input: string) {
    return await this.openAIProvider.fetchData(input);
  }

  async integrateCustomAPI(endpoint: string) {
    return await this.customAPIProvider.connectAndFetch(endpoint);
  }
}

Last updated