Skip to main content

A library for managing agents in Gen AI applications.

Project description

GLLM Agents

Description

A library for managing agents in Generative AI applications.

Installation

Prerequisites

1. Installation from Artifact Registry

Choose one of the following methods to install the package:

Using pip

pip install gllm-agents-binary

Using Poetry

poetry add gllm-agents-binary

2. Development Installation (Git)

For development purposes, you can install directly from the Git repository:

poetry add "git+ssh://git@github.com/GDP-ADMIN/gen-ai-internal.git#subdirectory=libs/gllm-agents"

Managing Dependencies

  1. Go to root folder of gllm-agents module, e.g. cd libs/gllm-agents.
  2. Run poetry shell to create a virtual environment.
  3. Run poetry lock to create a lock file if you haven't done it yet.
  4. Run poetry install to install the gllm-agents requirements for the first time.
  5. Run poetry update if you update any dependency module version at pyproject.toml.

Contributing

Please refer to this Python Style Guide to get information about code style, documentation standard, and SCA that you need to use when contributing to this project

  1. Activate pre-commit hooks using pre-commit install
  2. Run poetry shell to create a virtual environment.
  3. Run poetry lock to create a lock file if you haven't done it yet.
  4. Run poetry install to install the gllm-agents requirements for the first time.
  5. Run which python to get the path to be referenced at Visual Studio Code interpreter path (Ctrl+Shift+P or Cmd+Shift+P)
  6. Try running the unit test to see if it's working:
poetry run pytest -s tests/unit_tests/

Hello World Examples

Prerequisites

  • Python 3.13+
  • Install the binary package:
pip install gllm-agents-binary
  • For OpenAI: Set your API key in the environment:
export OPENAI_API_KEY=your-openai-key
  • For Google ADK: Set your API key in the environment:
export GOOGLE_API_KEY=your-google-api-key

Run the Hello World Examples

The example scripts are located in the gllm_agents/examples directory within the library. You can run them individually or use the run_all_examples.py script.

1. Running Individual Examples:

Navigate to the library's root directory (e.g., libs/gllm-agents if you cloned the repository).

LangGraph (OpenAI):

python gllm_agents/examples/hello_world_langgraph.py

LangGraph with BOSA Connector (OpenAI):

python gllm_agents/examples/hello_world_langgraph_bosa_twitter.py

LangGraph Streaming (OpenAI):

python gllm_agents/examples/hello_world_langgraph_stream.py

LangGraph Multi-Agent Coordinator (OpenAI):

python gllm_agents/examples/hello_world_multi_agent_coordinator.py

Google ADK:

python gllm_agents/examples/hello_world_google_adk.py

Google ADK Streaming:

python gllm_agents/examples/hello_world_google_adk_stream.py

LangChain (OpenAI):

python gllm_agents/examples/hello_world_langchain.py

LangChain Streaming (OpenAI):

python gllm_agents/examples/hello_world_langchain_stream.py

2. Running Individual MCP Examples:

  • Navigate to the library's root directory (e.g., libs/gllm-agents if you cloned the repository).

  • Open a new terminal and navigate to the sample MCP servers directory libs/gllm-agents/gllm_agents/examples/mcp_servers

    Turn on the SSE MCP servers:

    python mcp_server_sse.py
    
  • Open a new terminal and navigate to the sample MCP servers directory libs/gllm-agents/gllm_agents/examples/mcp_servers

    Turn on the STDIO MCP servers:

    python mcp_server_stdio.py
    

LangGraph SSE Transport (OpenAI):

python gllm_agents/examples/hello_world_langgraph_mcp_sse.py

LangGraph Streaming SSE Transport (OpenAI):

python gllm_agents/examples/hello_world_langgraph_mcp_sse_stream.py

LangGraph STDIO Transport (OpenAI):

python gllm_agents/examples/hello_world_langgraph_mcp_stdio.py

LangGraph Streaming STDIO Transport (OpenAI):

python gllm_agents/examples/hello_world_langgraph_mcp_stdio_stream.py

Google ADK SSE Transport:

python gllm_agents/examples/hello_world_google_adk_mcp_sse.py

Google ADK Streaming SSE Transport:

python gllm_agents/examples/hello_world_google_adk_mcp_sse_stream.py

Google ADK STDIO Transport:

python gllm_agents/examples/hello_world_google_adk_mcp_stdio.py

Google ADK Streaming STDIO Transport:

python gllm_agents/examples/hello_world_google_adk_mcp_stdio_stream.py

LangChain SSE Transport (OpenAI):

python gllm_agents/examples/hello_world_langchain_mcp_sse.py

LangChain Streaming SSE Transport (OpenAI):

python gllm_agents/examples/hello_world_langchain_mcp_sse_stream.py

LangChain STDIO Transport (OpenAI):

python gllm_agents/examples/hello_world_langchain_mcp_stdio.py

LangChain Streaming STDIO Transport (OpenAI):

python gllm_agents/examples/hello_world_langchain_mcp_stdio_stream.py

3. Running Individual A2A Examples:

  • Navigate to the library's root directory (e.g., libs/gllm-agents if you cloned the repository).
  • Open a new terminal and navigate to the gllm_agents/examples directory to run the A2A server.

LangChain Server:

python hello_world_a2a_langchain_server.py
  • Open a new terminal and navigate to the gllm_agents/examples directory to run the A2A client.

LangChain Client:

python hello_world_a2a_langchain_client.py

LangChain Client Integrated with Agent Workflow:

python hello_world_a2a_langchain_client_agent.py

LangChain Client Streaming:

python hello_world_a2a_langchain_client_stream.py

Architectural Notes

Agent Interface (AgentInterface)

The gllm_agents.agent.interface.AgentInterface class defines a standardized contract for all agent implementations within the GLLM Agents ecosystem. It ensures that different agent types (e.g., LangGraph-based, Google ADK-based) expose a consistent set of methods for core operations.

Key methods defined by AgentInterface typically include:

  • arun(): For asynchronous execution of the agent that returns a final consolidated response.
  • arun_stream(): For asynchronous execution that streams back partial responses or events from the agent.

By adhering to this interface, users can interact with various agents in a uniform way, making it easier to switch between or combine different agent technologies.

Inversion of Control (IoC) / Dependency Injection (DI)

The agent implementations (e.g., LangGraphAgent, GoogleADKAgent) utilize Dependency Injection. For instance, LangGraphAgent accepts an agent_executor (like one created by LangGraph's create_react_agent) in its constructor. Similarly, GoogleADKAgent accepts a native adk_native_agent. This allows the core execution logic to be provided externally, promoting flexibility and decoupling the agent wrapper from the specific instantiation details of its underlying engine.

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

gllm_agents_binary-0.2.34-cp313-cp313-win_amd64.whl (1.4 MB view details)

Uploaded CPython 3.13Windows x86-64

gllm_agents_binary-0.2.34-cp313-cp313-manylinux_2_31_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.2.34-cp313-cp313-macosx_13_0_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.13macOS 13.0+ x86-64

gllm_agents_binary-0.2.34-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl (1.5 MB view details)

Uploaded CPython 3.13macOS 13.0+ ARM64macOS 15.0+ ARM64

gllm_agents_binary-0.2.34-cp312-cp312-win_amd64.whl (1.4 MB view details)

Uploaded CPython 3.12Windows x86-64

gllm_agents_binary-0.2.34-cp312-cp312-manylinux_2_31_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.2.34-cp312-cp312-macosx_13_0_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.12macOS 13.0+ x86-64

gllm_agents_binary-0.2.34-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl (1.5 MB view details)

Uploaded CPython 3.12macOS 13.0+ ARM64macOS 15.0+ ARM64

gllm_agents_binary-0.2.34-cp311-cp311-win_amd64.whl (1.4 MB view details)

Uploaded CPython 3.11Windows x86-64

gllm_agents_binary-0.2.34-cp311-cp311-manylinux_2_31_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.2.34-cp311-cp311-macosx_13_0_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.11macOS 13.0+ x86-64

gllm_agents_binary-0.2.34-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl (1.5 MB view details)

Uploaded CPython 3.11macOS 13.0+ ARM64macOS 15.0+ ARM64

File details

Details for the file gllm_agents_binary-0.2.34-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.34-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 799238d662824e7d5163c34bce79978d06b22fcda76b8467e9b0666cc58eb73a
MD5 a6e8a23487e5f4cb21efc9def31878a9
BLAKE2b-256 46f8bc0874c665dad934f77cb952405ec52bd8d35203f5c5854c5f57e0dd8e25

See more details on using hashes here.

Provenance

The following attestation bundles were made for gllm_agents_binary-0.2.34-cp313-cp313-win_amd64.whl:

Publisher: build-binary.yml on GDP-ADMIN/gl-sdk

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

File details

Details for the file gllm_agents_binary-0.2.34-cp313-cp313-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.34-cp313-cp313-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 1305debd93e734681acd420578f17fad260b086cd0cd7c17c963a68cf0171e4c
MD5 de29715d6c526ff22d0677df31a19847
BLAKE2b-256 c7dd38ca4e37dad7bb6941d708e9358ac5566e48c07aa979da240ca9d76ca954

See more details on using hashes here.

File details

Details for the file gllm_agents_binary-0.2.34-cp313-cp313-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.34-cp313-cp313-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 daf79c0160b07537a6c17551667a158609912cd38b6bb999a78653201f0adbdf
MD5 2e02cf9a88886479ce5789a57f36aae4
BLAKE2b-256 2e3151c5ea47ffff4cc731b006b53540afa560ad963380cf90bde54fa4ccfff0

See more details on using hashes here.

Provenance

The following attestation bundles were made for gllm_agents_binary-0.2.34-cp313-cp313-macosx_13_0_x86_64.whl:

Publisher: build-binary.yml on GDP-ADMIN/gl-sdk

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

File details

Details for the file gllm_agents_binary-0.2.34-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.34-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 20d5dc8abb10f121a614aec2428a01f603bae32d7487e8eb82d540491a89e5ae
MD5 9be5d3dd78c816ab071b47cdc29f4eae
BLAKE2b-256 d405f5a208c234180d3270175d9575fe2396adf0339c7721d2819a90508962bd

See more details on using hashes here.

Provenance

The following attestation bundles were made for gllm_agents_binary-0.2.34-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl:

Publisher: build-binary.yml on GDP-ADMIN/gl-sdk

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

File details

Details for the file gllm_agents_binary-0.2.34-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.34-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 62e6e3e1fa278df4f68fc0afd43af7c8c14c5f3401d1175268cc621fb38db1c0
MD5 84d84134e1361681deffc29143a3f7d8
BLAKE2b-256 3750a905fd24372ce765db3be3c51547a3a5d2d7500f4081d85868c77ebf7391

See more details on using hashes here.

Provenance

The following attestation bundles were made for gllm_agents_binary-0.2.34-cp312-cp312-win_amd64.whl:

Publisher: build-binary.yml on GDP-ADMIN/gl-sdk

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

File details

Details for the file gllm_agents_binary-0.2.34-cp312-cp312-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.34-cp312-cp312-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 753a14931f952589b9d9d04a3d5a96843ee8d4d51944406aad33fb0cfd50d479
MD5 d491a95fb112aed76ff67cc4ba6be49e
BLAKE2b-256 ff693bd34909bc27a4d05f9338100bf7fa47c8ec853ec14924e9ff8b6819f0c7

See more details on using hashes here.

File details

Details for the file gllm_agents_binary-0.2.34-cp312-cp312-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.34-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 ec37e1dfbd4f207ec7a52cf610eb50667cd3eba8949bb9969ebc5715de3e19a6
MD5 f571eaf9708cbbb1c4316a4aba22c0e1
BLAKE2b-256 48f373c714b3f000a5a0d6acd7064f365193f748afbe01dd648e6c956c8cd96e

See more details on using hashes here.

Provenance

The following attestation bundles were made for gllm_agents_binary-0.2.34-cp312-cp312-macosx_13_0_x86_64.whl:

Publisher: build-binary.yml on GDP-ADMIN/gl-sdk

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

File details

Details for the file gllm_agents_binary-0.2.34-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.34-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 1ae38165c7b8042a09d6ebc0861403dbea03cb6c5e7e031c6fa598ba8070c61b
MD5 7a02a2df1fb36d9f940ea5ee36b141a9
BLAKE2b-256 0879dc8c2a80083e143579d049609c4dd2510fa4eb955980d916dbcb3e1b2678

See more details on using hashes here.

Provenance

The following attestation bundles were made for gllm_agents_binary-0.2.34-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl:

Publisher: build-binary.yml on GDP-ADMIN/gl-sdk

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

File details

Details for the file gllm_agents_binary-0.2.34-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.34-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 8fadab528ddf4e9e73cef65994a6f1a4fa0aac076742a8b9b0374be7eb2de50c
MD5 3a01e8004ab21f706cca5ca561ef5572
BLAKE2b-256 d933135e6c6b1ad4d242af464cd76ed3c5cdd2d27e541585e8d090a376f0d64c

See more details on using hashes here.

Provenance

The following attestation bundles were made for gllm_agents_binary-0.2.34-cp311-cp311-win_amd64.whl:

Publisher: build-binary.yml on GDP-ADMIN/gl-sdk

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

File details

Details for the file gllm_agents_binary-0.2.34-cp311-cp311-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.34-cp311-cp311-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 f3d239ca81b1f0949b5551e19c550d7c3f3d4b4108058cfcad94efad22f7cc41
MD5 e7bcedd965493e68aa334a8aa09b4cdc
BLAKE2b-256 a69beb3d612e166b69434e3fc35a224370c1aef2a5995e6c8fd0e10a8969bec5

See more details on using hashes here.

File details

Details for the file gllm_agents_binary-0.2.34-cp311-cp311-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.34-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 b80f2faf25afe3ce32143269cdfe096c7fa6c5be38dde953cfd8b2e43fee179a
MD5 02a69edab6215fdfd4d755ce410c80c5
BLAKE2b-256 b922b6e59b5844eb55d7620affef29422d9565de74e1d61551b009c793655cbb

See more details on using hashes here.

Provenance

The following attestation bundles were made for gllm_agents_binary-0.2.34-cp311-cp311-macosx_13_0_x86_64.whl:

Publisher: build-binary.yml on GDP-ADMIN/gl-sdk

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

File details

Details for the file gllm_agents_binary-0.2.34-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.34-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 dd8a91f392022988d9d5f2819d5810866b6d014cd40fc181840e6094b34a49f0
MD5 b687584cddb9e04e48c5fce829420ae8
BLAKE2b-256 aaf30438d89b96bdfabc6ecaa89ed0856ca00895f3c04780191576e1544f8ccc

See more details on using hashes here.

Provenance

The following attestation bundles were made for gllm_agents_binary-0.2.34-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl:

Publisher: build-binary.yml on GDP-ADMIN/gl-sdk

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