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

Uploaded CPython 3.13Windows x86-64

gllm_agents_binary-0.2.30-cp313-cp313-manylinux_2_31_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.2.30-cp313-cp313-macosx_13_0_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.13macOS 13.0+ x86-64

gllm_agents_binary-0.2.30-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.30-cp312-cp312-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.12Windows x86-64

gllm_agents_binary-0.2.30-cp312-cp312-manylinux_2_31_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.2.30-cp312-cp312-macosx_13_0_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.12macOS 13.0+ x86-64

gllm_agents_binary-0.2.30-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.30-cp311-cp311-win_amd64.whl (1.3 MB view details)

Uploaded CPython 3.11Windows x86-64

gllm_agents_binary-0.2.30-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.30-cp311-cp311-macosx_13_0_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.11macOS 13.0+ x86-64

gllm_agents_binary-0.2.30-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.30-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.30-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 1539e3a7b65a1227a758f49457c1ab490963dd7c36a3d616ee911d5b705bf16f
MD5 b1886be3743ce36a3b77603c92d36e74
BLAKE2b-256 5030a4746398bffa00999e4bd85293d2171b5376eaa049f60747f3330d753c18

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.30-cp313-cp313-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 79033dfcf87160179180b6d68eaa633bdc6e6ad903b9fbefe19ab492cd2e7b3a
MD5 b2f9be8235b5fed3d694cd071b063ba6
BLAKE2b-256 0f7add2d858952a459e79e5ea67afe83ed689bd23b0c86060f5bed7481eea3c4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.30-cp313-cp313-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 3a2353c1a62dbb4619d3094650c7182678815f1b45ae8bb2bcc5f2f2828d7d12
MD5 60325c9496cd5d5305fbaa8017841695
BLAKE2b-256 46a51e31e441af7141f413309b8c30e1ca0b95672172e4aeb9c98a94c032bf5e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.30-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 2e248a2e8edd574d792c49a911032cd4842dfec96c9a7eb3b21d9553b6a35e5c
MD5 82d8398f94f540d895863fa9bdbfd594
BLAKE2b-256 143d34238c86ed44fe90de1b18c78181e19f07b13ac500b5182838ae1c6d8ab9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.30-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 0d58d3ccc7d2d0297b19ecaf2d5a394173280850cb2c459a1e4dc8b7a69cc741
MD5 fc5e8d1b58bfc8bf6392261c1c7ff054
BLAKE2b-256 7eac379c8855b46a57318365f0b601c57a1d63e3f9cdda25803aa2f2361aac7e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.30-cp312-cp312-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 e5585d389c68d9466830437d1cc1893dc38cef5b6c911329a99c6cf01cbc93d8
MD5 ef00ecaa30c0a704675ecf677a53f707
BLAKE2b-256 7fb49e17def6807f078aefe435c1e5c8d58d5ef277a3f3447753cc672f607026

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.30-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 957a295e0e91fd49528e1f36d68af65be5023cd7d6b5369cd9050516f2b25eb5
MD5 5daf79f9538ea1cfb08f3762c3d78445
BLAKE2b-256 e7b37c38ca7d957250153e3cdc5f46814eb3e82b50324b757f4304c0fb3ee83e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.30-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 43da086fc85a96bd4a40114a8f070150bdebb8fff37027c2d68e39012917126e
MD5 6b2d881fef52cab16745acefe89bcf77
BLAKE2b-256 fe6cab047a03f8a03921b0c75a22e47619e654376d61698b882f5bbd62db4044

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.30-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 09825fca607af5fc215bfe65ed0e7815e58fcc5714582f5b3ae226b1d339a770
MD5 6e1794c71bec06d850ff9fe8467213ca
BLAKE2b-256 41de6c0cf749992266edf7185abcdd6e3315730bc69241b06afa23ca1aa11a89

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.30-cp311-cp311-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 5ccd113ae4d2bb2bfa8c0983d04e85adf9e8f1baa2d5902472ebad04578295c6
MD5 24e2fd650ef2d4b0cca0791318632699
BLAKE2b-256 185da1b24dc95ef7f7f5bfc5d1f24dbcd83357db6274cf2b9ea3124bca725da5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.30-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 b70bc9a38bc84d354dd03697490fefee5582c980da40afdff07d828b7ecbf9b5
MD5 8afa52049663e8673ba0082a08792e26
BLAKE2b-256 a1a7884ae4fa1f4e04690a381e057cac946cebe73cb76c6874ce0c137c634997

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.30-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 5f37c3f8c15ab7d0ce617d0ad26f3c2ec37fae0e9b0a691607a21cf2977b3778
MD5 b9156a4a9131664ab75214928f848e5a
BLAKE2b-256 5a5da7e2f94af6686c873ceae396e1c1d53e1b886af3fefe92d7aa07c9245e4d

See more details on using hashes here.

Provenance

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