effect-io-ai

Package: @effect/ai
Module: IdGenerator

IdGenerator.IdGenerator

The IdGenerator service tag for dependency injection.

This tag is used to provide and access ID generation functionality throughout the application. It follows Effect’s standard service pattern for type-safe dependency injection.

Example

import { IdGenerator } from "@effect/ai"
import { Effect } from "effect"

const useIdGenerator = Effect.gen(function* () {
  const idGenerator = yield* IdGenerator.IdGenerator
  const newId = yield* idGenerator.generateId()
  return newId
})

Signature

declare class IdGenerator

Source

Since v1.0.0