Show HN:我開發了一個用於組合式優先 AI 編程的 Python 函式庫

Show HN:我開發了一個用於組合式優先 AI 編程的 Python 函式庫

Hacker News·

一位開發者展示了名為「funcai」的新 Python 函式庫,該函式庫專為組合式優先的 AI 編程而設計,讓 LLM 互動能夠像函式一樣建構,而非繼承鏈。

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

To see all available qualifiers, see our documentation.

Intelligence is a function.

Uh oh!

There was an error while loading. Please reload this page.

prostomarkeloff/funcai

Folders and files

Latest commit

History

Repository files navigation

funcai

「 intelligence is a function 」

Compose LLM interactions like functions, not inheritance chains.

agent returns LazyCoroResult[AgentResponse, AgentError] — lazy, typed, composable.

Why funcai?

Installation

Two Ways to Compose

funcai offers two complementary approaches:

1. Direct Combinators — Simple & Explicit

Use combinators.py for straightforward composition:

2. Typed DSL — Analyze Before Execute

Build programs as AST, analyze statically, then compile:

The DSL — Programs as Data

The DSL represents AI workflows as an Abstract Syntax Tree (AST). This unlocks:

Static Analysis

Type-Safe Builder

DSL Operations

Combinators

funcai uses combinators.py for generic async combinators, plus domain-specific combinators for dialogue manipulation:

Examples

Tools & Agents

Tools are functions with a description for the LLM:

agent runs the ReAct loop (Reason + Act):

Extensibility

Custom Providers

Custom Agents

Result Types

funcai uses kungfu:

vs LangChain

Architecture

Category-theoretically:

Quick Start Example

Requirements: Python 3.14+, kungfu, combinators.py

Author: @prostomarkeloff

License: MIT

About

Intelligence is a function.

Resources

Uh oh!

There was an error while loading. Please reload this page.

Stars

Watchers

Forks

Releases

Packages

  0

Contributors

  2

Uh oh!

There was an error while loading. Please reload this page.

Languages

Footer

Footer navigation

Hacker News

相關文章

其他收藏 · 0