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 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.12-cp313-cp313-win_amd64.whl (824.9 kB view details)

Uploaded CPython 3.13Windows x86-64

gllm_agents_binary-0.2.12-cp313-cp313-manylinux_2_31_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.2.12-cp313-cp313-macosx_14_0_arm64.whl (925.0 kB view details)

Uploaded CPython 3.13macOS 14.0+ ARM64

gllm_agents_binary-0.2.12-cp313-cp313-macosx_13_0_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.13macOS 13.0+ x86-64

gllm_agents_binary-0.2.12-cp312-cp312-win_amd64.whl (829.6 kB view details)

Uploaded CPython 3.12Windows x86-64

gllm_agents_binary-0.2.12-cp312-cp312-manylinux_2_31_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.2.12-cp312-cp312-macosx_14_0_arm64.whl (917.2 kB view details)

Uploaded CPython 3.12macOS 14.0+ ARM64

gllm_agents_binary-0.2.12-cp312-cp312-macosx_13_0_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.12macOS 13.0+ x86-64

gllm_agents_binary-0.2.12-cp311-cp311-win_amd64.whl (845.1 kB view details)

Uploaded CPython 3.11Windows x86-64

gllm_agents_binary-0.2.12-cp311-cp311-manylinux_2_31_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.2.12-cp311-cp311-macosx_14_0_arm64.whl (916.8 kB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

gllm_agents_binary-0.2.12-cp311-cp311-macosx_13_0_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.11macOS 13.0+ x86-64

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.12-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 4f4860592bbd5a35624ac220d098ac23610a655e7b2e1334286cf8163211d44e
MD5 f9fb6da9070f429324954efd879f75e6
BLAKE2b-256 ce627bb943c2625b34910489d4b0259f222ca3cdd00f0d55ef7cb5ff0565fa68

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.12-cp313-cp313-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 214d7e5c56c2e818dddeef1499e20e77aa52e27948884f66f9a724726a89eeaa
MD5 3e075c9eead9a9412cf4bdfabce757f8
BLAKE2b-256 9bed7b6fdd5958a03435b753f9e31544c700df678e1eda120c175c099e851a7d

See more details on using hashes here.

File details

Details for the file gllm_agents_binary-0.2.12-cp313-cp313-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.12-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 894dda21a2c3961f03d178a48aab8cf7bdd903eb788733fe3085786e114f0402
MD5 db3b963616e1c3d78b7b891167073bc0
BLAKE2b-256 aca2f78313aa292b965df8a7c2a16203bc237f93b6c6a1fe8ab7f1cc6d193dd8

See more details on using hashes here.

Provenance

The following attestation bundles were made for gllm_agents_binary-0.2.12-cp313-cp313-macosx_14_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.12-cp313-cp313-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.12-cp313-cp313-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 eb9c578185591d9b1c29e55236324088a83908f7f05c19f70cb77e1491d1b070
MD5 9786c3186558376cb643b331fb2baf51
BLAKE2b-256 e0bd351142fa6f7530f1b4cc552c4f095997b8b254b2c1082717827a95517db9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.12-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 fd366e9340b2a5eaa57f653187512790e0b8a40bdff6b4d2a0ec8fa2e9ac193f
MD5 7fef4be4a81fa9975c6a267ae1b235cd
BLAKE2b-256 a9a329f98e0f603fa28a9e649a193fc4805ce372fa418e10b7b34d178a1111bc

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.12-cp312-cp312-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 14897cb7f3a8f2b8d66c20846d9d4f0fa9f5ea19bdc2e8b71333288caa3d4c9e
MD5 c24ba5a0361c36f103af8ebfb2187a5e
BLAKE2b-256 ba6a47309763798f8ce73b88450aeea287e059e49d616f85ef625697dc2c8564

See more details on using hashes here.

File details

Details for the file gllm_agents_binary-0.2.12-cp312-cp312-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.12-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 4a517f85183f7c72359848da4f12e49091c4dfa5049286855fd578418bd143ae
MD5 42b0c6d2b878cf19b7d8699aef6676b3
BLAKE2b-256 ff1369ffd1fa1a6b8498afb47513dcf6151c2aae431974b14c368da302886677

See more details on using hashes here.

Provenance

The following attestation bundles were made for gllm_agents_binary-0.2.12-cp312-cp312-macosx_14_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.12-cp312-cp312-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.12-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 1ece90be9cd081eab1712cff668e38ac39f4d94a52cc80feb39645805b7b6124
MD5 fd9823b477e4299c170251e38848ef68
BLAKE2b-256 a80089c394a4b841a8980132a2323313748a741f4b1bc228e11ad8fbd14c615a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.12-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 07bd0a2fa54e5dded872de30c3d2cbbf3e8289314b6f06d34c7656939788e8e0
MD5 d234a19f5ea71a0882cd56971c55e22e
BLAKE2b-256 c115753df0b82c724de2da81ac9002739a863e5628087330f3fa1d84681ba3bc

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.12-cp311-cp311-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 d159c687d2eccf5513cef643e6c236a6e4d7d6ed58e9822c79a03a808b5b72fb
MD5 f5dc6e05d9253c84a1f77c1a98b6ddcb
BLAKE2b-256 18df29f20a3e13c98eb62e6e6323b07a78cce0efd2c6d727eb0886865e0c8409

See more details on using hashes here.

File details

Details for the file gllm_agents_binary-0.2.12-cp311-cp311-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.12-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 acb0ba0e3907ea65503bda593eb0744a67417d546adf5beffde2f4c7ab97465f
MD5 1234a8dbd8428c91ebf7fa324749d853
BLAKE2b-256 ac5839e6a97f407d9fabcb0f33dc26fe7c8096b76720a8d21bb1a30b88ae1c35

See more details on using hashes here.

Provenance

The following attestation bundles were made for gllm_agents_binary-0.2.12-cp311-cp311-macosx_14_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.12-cp311-cp311-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.12-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 ef542e03d17dd04bf10ef1afa71030a3a237b2e4b941b958b9b207ef805ac094
MD5 bb2a4c2d7c26b35173068ac3e0cb6b83
BLAKE2b-256 85c1805b23a839420792f0afdd4791721136dca21f56e65905c1f1da597ffeb0

See more details on using hashes here.

Provenance

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

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