Skip to main content

Genkit AI Framework

Project description

genkit

Genkit is a framework designed to help you build AI-powered applications and features. It provides open source libraries for Python, Node.js and Go, plus developer tools for testing and debugging.

You can deploy and run Genkit libraries anywhere Python is supported. It's designed to work with many AI model providers and vector databases. While we offer integrations for Firebase and Google Cloud, you can use Genkit independently of any Google services.

Setup Instructions

pip install genkit
pip install genkit-plugin-google-genai
from pydantic import BaseModel, Field
from genkit import Genkit
from genkit.plugins.google_genai import GoogleAI

ai = Genkit(
    plugins=[GoogleAI()],
    model='googleai/gemini-2.0-flash',
)


class RpgCharacter(BaseModel):
    """An RPG game character."""

    name: str = Field(description='name of the character')
    back_story: str = Field(description='back story')
    abilities: list[str] = Field(description='list of abilities (3-4)')


@ai.flow()
async def generate_character(name: str) -> RpgCharacter:
    result = await ai.generate(
        prompt=f'generate an RPG character named {name}',
        output_schema=RpgCharacter,
    )
    return result.output


async def main() -> None:
    """Main function."""
    character = await generate_character('Goblorb')
    print(character.model_dump_json(indent=2))


if __name__ == '__main__':
    ai.run_main(main())

See https://python.api.genkit.dev for more details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

genkit-0.6.0rc1.tar.gz (183.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

genkit-0.6.0rc1-py3-none-any.whl (153.4 kB view details)

Uploaded Python 3

File details

Details for the file genkit-0.6.0rc1.tar.gz.

File metadata

  • Download URL: genkit-0.6.0rc1.tar.gz
  • Upload date:
  • Size: 183.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for genkit-0.6.0rc1.tar.gz
Algorithm Hash digest
SHA256 47a9a507957f6fee9ee92cfa4778c271c272b219d3324066ae0a32e3f9a7c1dd
MD5 2efc0e16ef7a0358a97cb7776bba7794
BLAKE2b-256 7a8f09f07d7c3508ac1a020b73c472f33d6f7e37bca68275f7ef55fc8c9b771d

See more details on using hashes here.

Provenance

The following attestation bundles were made for genkit-0.6.0rc1.tar.gz:

Publisher: publish_python.yml on genkit-ai/genkit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file genkit-0.6.0rc1-py3-none-any.whl.

File metadata

  • Download URL: genkit-0.6.0rc1-py3-none-any.whl
  • Upload date:
  • Size: 153.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for genkit-0.6.0rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 653e2e66e8dfea28caab34e68e43e66cba16243197b4f2a12b4d3a502bc3fa8d
MD5 53f02ef268854c26c2d4ecde3a4084ef
BLAKE2b-256 695a3ef8c962d4291471b79e0993bb55a0231affa65b1e537ab051116c4eee98

See more details on using hashes here.

Provenance

The following attestation bundles were made for genkit-0.6.0rc1-py3-none-any.whl:

Publisher: publish_python.yml on genkit-ai/genkit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page