Thanks to visit codestin.com
Credit goes to github.com

Skip to content

harrysolovay/liminal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Liminal

Liminal is a work in progress. The documentation may not reflect the current implementation.

Liminal is an Effect-based library for composing conversation trees with language models.

Overview

An effect is a conversation.

example.ts

import { FileSystem } from "@effect/platform"
import { Effect } from "effect"
import { L } from "liminal"

const conversation = Effect.gen(function*() {
  // Set system instruction.
  yield* L.system`You are an expert TypeScript developer.`

  // Get a file system service.
  const fs = yield* FileSystem.FileSystem

  // Append messages.
  yield* L.user`
    It seems as though a new mental model may arise for
    LLM conversation state management.

    What are your thoughts on the following DX?

    ${fs.readFileString("example.ts")}
  `

  // Infer and append the assistant message.
  const answer = yield* L.assistant

  answer satisfies string

  // List all messages.
  const messages = yield* L.messages

  // Clear all messages.
  yield* L.clear

  // Re-append messages.
  yield* L.append(...messages)
}).pipe(
  L.thread,
)

Running Examples Locally

  1. Clone and build Liminal.

    git clone [email protected]:harrysolovay/liminal.git
    cd liminal
    bun i
    bun run build
  2. Configure any environment variables used by the example.

  3. Run the example script.

    bun examples/<path-to-example>

Code of Conduct

Please ensure you adhere to our code of conduct when interacting in this repository.


Contributing

Contributions are welcome and appreciated! Check out the contributing guide before you dive in.


License

Liminal is Apache-licensed.

About

An Effect AI toolkit for conversation state management.

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •