Skip to content

GoogleClient

5 exports Added in v1.0.0 Source

Constructors

make

Added in v1.0.0 Source

Signature

declare function make(options: {
  readonly apiKey?: Redacted<string>;
  readonly apiUrl?: string;
  readonly transformClient?: (client: HttpClient) => HttpClient;
}): Effect<Service, never, any>;

Context

GoogleClient

Added in v1.0.0 Source

Signature

declare class GoogleClient extends any {
  constructor();
}

Layers

layer

Added in v1.0.0 Source

Signature

declare function layer(options: {
  readonly apiKey?: Redacted<string>;
  readonly apiUrl?: string;
  readonly transformClient?: (client: HttpClient) => HttpClient;
}): Layer<GoogleClient, never, HttpClient>;

layerConfig

Added in v1.0.0 Source

Signature

declare function layerConfig(options: {
  readonly apiKey?: Config<Redacted<string> | undefined>;
  readonly apiUrl?: Config<string | undefined>;
  readonly transformClient?: (client: HttpClient) => HttpClient;
}): Layer<GoogleClient, ConfigError, HttpClient>;

Models

Service interface

Added in v1.0.0 Source

Signature

interface Service {
  readonly client: Client;
  readonly generateContent: (request: {
    [key: string]: any;
  }) => Effect<GenerateContentResponse, AiError>;
  readonly generateContentStream: (request: {
    [key: string]: any;
  }) => Stream<GenerateContentResponse, AiError>;
  readonly streamRequest: <A, I, R>(
    request: HttpClientRequest,
    schema: any,
  ) => Stream<A, AiError, R>;
}