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.28-cp313-cp313-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.13Windows x86-64

gllm_agents_binary-0.2.28-cp313-cp313-manylinux_2_31_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.2.28-cp313-cp313-macosx_13_0_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.13macOS 13.0+ x86-64

gllm_agents_binary-0.2.28-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.13macOS 13.0+ ARM64macOS 15.0+ ARM64

gllm_agents_binary-0.2.28-cp312-cp312-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.12Windows x86-64

gllm_agents_binary-0.2.28-cp312-cp312-manylinux_2_31_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.2.28-cp312-cp312-macosx_13_0_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.12macOS 13.0+ x86-64

gllm_agents_binary-0.2.28-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.12macOS 13.0+ ARM64macOS 15.0+ ARM64

gllm_agents_binary-0.2.28-cp311-cp311-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.11Windows x86-64

gllm_agents_binary-0.2.28-cp311-cp311-manylinux_2_31_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.2.28-cp311-cp311-macosx_13_0_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.11macOS 13.0+ x86-64

gllm_agents_binary-0.2.28-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.11macOS 13.0+ ARM64macOS 15.0+ ARM64

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.28-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 6ad09b520482926b6ca49f883fd714f186b6e4fce128a0ef7c13637b9b839c21
MD5 077bd245c0e7eaec47b65918e09c8bce
BLAKE2b-256 0e2f802c269824c8b89a6e00a2bc6b4ecd25076ce97e4a1fb97ded97e743efb2

See more details on using hashes here.

Provenance

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

Publisher: build-binary.yml on GDP-ADMIN/gen-ai-internal

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.28-cp313-cp313-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.28-cp313-cp313-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 31ced30c84fc7abaae678fd58f5f794c8fc31fa65a8bfdd3782e4b7deb04c0cd
MD5 e255e74af19de570a392c7054f62030a
BLAKE2b-256 dbbf3a40ff4e689ffdda04329ca0ce3a53110871269961dc6c6ca87635d326dc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.28-cp313-cp313-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 c60cae170a63b52b2ed45ba435493da0237cda1866ce02fb1f7bfa37b9f14cb1
MD5 9594f7208b9d3bab0b7f8e1e12f76352
BLAKE2b-256 007114164ec89985779ee594dec7722d3d43bd422e2328fb55ceffd99e4ec870

See more details on using hashes here.

Provenance

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

Publisher: build-binary.yml on GDP-ADMIN/gen-ai-internal

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.28-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.28-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 3c4aeafa90732bf4c9c1d0f407d2d1b4a7dbe2662339ee3c0ba7cdfc016455aa
MD5 4a7d7d15ee4bdb20b9a936d5ca6a67f7
BLAKE2b-256 a371085042ee740dc2bc0f3e8bbb7aea460afcc576a431bb08979c06ffabb639

See more details on using hashes here.

Provenance

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

Publisher: build-binary.yml on GDP-ADMIN/gen-ai-internal

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.28-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.28-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 ca306eda7262f73bb4f97176680c48d0a79fb6c053b0ad4d5e448ccbaa0c685f
MD5 2f1b2518734cfd720c7586ed0358eae2
BLAKE2b-256 74b9d3d029b5be0abb1c28226fdc1357044d2b770ed1c4fa0ed4b5b6783fa05f

See more details on using hashes here.

Provenance

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

Publisher: build-binary.yml on GDP-ADMIN/gen-ai-internal

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.28-cp312-cp312-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.28-cp312-cp312-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 5901dc91b8a33772777f49213a4a38d5d35978b79b6e16b80d1bd9fa5cc9df28
MD5 5c9850084f828f14518e6e2c0e681fd8
BLAKE2b-256 7a6d5ba2debcaac15126d17fe61c050363579f3ed7d987a32353730b782b27f7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.28-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 39ef269cc3d66f16b9588d590088e8fab4116b5ec174412b1f6260effc2dca57
MD5 201cf5255cf8e2b0309247510955fcd8
BLAKE2b-256 8d9c6d665d5558940a46d22d59423cceefedce74f1e0f43882ef76d7c7a1af8c

See more details on using hashes here.

Provenance

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

Publisher: build-binary.yml on GDP-ADMIN/gen-ai-internal

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.28-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.28-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 6d8757a6cf4d91bbef2a5565352fc38b88dfdc415d6242eea58b2409b3ad77de
MD5 f9038610bb01d752022c166dcaaae91e
BLAKE2b-256 3e73f6e28bc560b205ee83575942018ae1dcf66981da226524deea066e424b2f

See more details on using hashes here.

Provenance

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

Publisher: build-binary.yml on GDP-ADMIN/gen-ai-internal

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.28-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.28-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 405cb4bea38b2bc68b6f944518f7bd3b53ae5ec16e3f29dcf75b0af7d60ad42b
MD5 ddab2cb3f31423aae06613862e1cd990
BLAKE2b-256 31c5246ab348c6cef3785ed174a5f37203acef5ba1b0297abdf05ec4340e9256

See more details on using hashes here.

Provenance

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

Publisher: build-binary.yml on GDP-ADMIN/gen-ai-internal

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.28-cp311-cp311-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.28-cp311-cp311-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 7aca4a94759a3d6724ef2c2526d16a088bdd2f5397ca3c34161e3ca03af5bdef
MD5 d1b164af2ec554202d6c8bed659cd0fa
BLAKE2b-256 478c19a9288cfbd9ba899155f8ff46ceac81d58c4cb3df62c42590d2386bff8c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.28-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 8ea5668e34cd1cdf543058f1630458da23c2b59c0ad20b250aa58f626243c050
MD5 48eec3bbeb3bffa39cc6ae4b11b97f01
BLAKE2b-256 f6ae763e3e98a9e1c74feb98d4ad62574816fe5bf330a457f8af95b5f565040e

See more details on using hashes here.

Provenance

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

Publisher: build-binary.yml on GDP-ADMIN/gen-ai-internal

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.28-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.28-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 30e8af8ee9acbc5819bac7d036bcb2867d7c9b576d59e0f833b81e635f3125b4
MD5 d67cfb99b16e266f568c4cf2b6388eb5
BLAKE2b-256 76a9ab8f0e8b9605f002fd8173b134858cd2ebbf8e52ddbc960faaa66239a09b

See more details on using hashes here.

Provenance

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

Publisher: build-binary.yml on GDP-ADMIN/gen-ai-internal

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