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

Uploaded CPython 3.13Windows x86-64

gllm_agents_binary-0.2.35-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.35-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.35-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.35-cp312-cp312-win_amd64.whl (1.4 MB view details)

Uploaded CPython 3.12Windows x86-64

gllm_agents_binary-0.2.35-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.35-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.35-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.35-cp311-cp311-win_amd64.whl (1.4 MB view details)

Uploaded CPython 3.11Windows x86-64

gllm_agents_binary-0.2.35-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.35-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.35-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.35-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.35-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 010f2a20b4ca8459124798b77e1bbb93b692e10d4a961f3d919e565c537b6bd4
MD5 41539de127a6b3f035f241c8ecc06f2f
BLAKE2b-256 373e6d721e5900317475e062193dab422c88aea87f05a8d538097b10261e8c20

See more details on using hashes here.

Provenance

The following attestation bundles were made for gllm_agents_binary-0.2.35-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.35-cp313-cp313-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.35-cp313-cp313-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 fb965eed86ba04cb8652a2d83ed18e6f1fa0ae07041833abb108c46033a426b9
MD5 93972c7389874a9c5d4e5d22220182d9
BLAKE2b-256 b6eddc08c7efd248e2fb363d6bf8945691f7888899b65d6eda0451c9968447f0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.35-cp313-cp313-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 661a406b4b11004fbbb161374d03acb7bc24ff6c166158b128205f7a8d6f60c1
MD5 5de031c73d46c804aa1743b174b62332
BLAKE2b-256 dff2fd56126e9d8c0858b9fdbc9908b7f36ec39e0d23d29237a67fee0dda5688

See more details on using hashes here.

Provenance

The following attestation bundles were made for gllm_agents_binary-0.2.35-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.35-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.35-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 7000870176f744bbc8993256f86ba905cb0793ba0d0fb823829365f92ca072a5
MD5 bc51b84cec00de89d5e0a9894bdf0da4
BLAKE2b-256 0aeff46ab784e5769777c1ea1fdfccaa505a1fda05bdeab131b0bf7332995603

See more details on using hashes here.

Provenance

The following attestation bundles were made for gllm_agents_binary-0.2.35-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.35-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.35-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 38e30a2cff31c924ceef440370113c848c6bffe23d8f4a15ac32553d064f925f
MD5 9130bd7712a497d165b2a64bd7b787fa
BLAKE2b-256 71366f01b1ec5a0ca93ee3d3b733a24c2f1a6bc2d692425bd298026724bfb14f

See more details on using hashes here.

Provenance

The following attestation bundles were made for gllm_agents_binary-0.2.35-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.35-cp312-cp312-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.35-cp312-cp312-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 284e6375b2b29ba7201b176233a036761696ef40dc1c8bfc9befb65c7643e143
MD5 aa1adc91c7060f58ef573935137b83c1
BLAKE2b-256 ac695314213b025386c98f2d6fb0f025d0ce694cc29222b97c24ffb3e7f7db7b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.35-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 6b3b650475bd40a913b872426a0ed5fdb4465d79f125ab2f23ec8a89ee421582
MD5 4e2a5c5ee0ce6c5b7d6369759cd72556
BLAKE2b-256 ba70a22d4390235565853d2eb6f3f8276f7ed34e46e16e90c4495d5902008d38

See more details on using hashes here.

Provenance

The following attestation bundles were made for gllm_agents_binary-0.2.35-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.35-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.35-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 b782f82e5f7ff588a288a8ec8ee4f1b6bdbcc2dc8df487f6ee09372ccd10d1a0
MD5 6bc86fb2fa68e7313a58fc17663fdcfe
BLAKE2b-256 d5d5321ca4e9506e0af5696e916f8365651b4fc88a1a9eba55f5d9353b5659dd

See more details on using hashes here.

Provenance

The following attestation bundles were made for gllm_agents_binary-0.2.35-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.35-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.35-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 153c273c5c90b2cee53a7ee084dc2a7c5a7326db1bacef866de9baa649f5bcb5
MD5 8bbf347be4cfdccbd5ecaee6f1e79a98
BLAKE2b-256 0c133e44ab81187bb9554006056c5b977b468e14ad0146f7dea3579723f37c04

See more details on using hashes here.

Provenance

The following attestation bundles were made for gllm_agents_binary-0.2.35-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.35-cp311-cp311-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.35-cp311-cp311-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 edf41c384ee1ffbbcefecd5b31da628a0b4a02f171649266d1b8179902d50464
MD5 c194f0d8177ea9d43ff2a391f0c4f66c
BLAKE2b-256 4daca32645143a84852448632813d60e6298d93dd72912619208d39095ea8ea2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.35-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 014c9a47e040ebf3fc847ec02a454d0a12bb75b4b91a60e4643fa8777dd1a033
MD5 5ab8c7b5d95872c2ed5bf78d85511d2c
BLAKE2b-256 78b4fc2dd68ff617bd10c40e13c92bf2bfb9afa6f2af3db4c87ea0582456ae78

See more details on using hashes here.

Provenance

The following attestation bundles were made for gllm_agents_binary-0.2.35-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.35-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.35-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 de288b2f16c01bff4dfb8efbe19c930dd962695f77d9abeecc045f6ba170454e
MD5 a5bffdbc0bd0610206af6743e19ec664
BLAKE2b-256 99a8fe6b117e74453296e418e6c3746ab878094bac8e71e5c004b390da42bc13

See more details on using hashes here.

Provenance

The following attestation bundles were made for gllm_agents_binary-0.2.35-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