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

Uploaded CPython 3.13Windows x86-64

gllm_agents_binary-0.3.3-cp313-cp313-manylinux_2_31_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.3.3-cp313-cp313-macosx_13_0_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.13macOS 13.0+ x86-64

gllm_agents_binary-0.3.3-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl (1.6 MB view details)

Uploaded CPython 3.13macOS 13.0+ ARM64macOS 15.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

gllm_agents_binary-0.3.3-cp312-cp312-manylinux_2_31_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.3.3-cp312-cp312-macosx_13_0_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.12macOS 13.0+ x86-64

gllm_agents_binary-0.3.3-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl (1.6 MB view details)

Uploaded CPython 3.12macOS 13.0+ ARM64macOS 15.0+ ARM64

gllm_agents_binary-0.3.3-cp311-cp311-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.11Windows x86-64

gllm_agents_binary-0.3.3-cp311-cp311-manylinux_2_31_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.3.3-cp311-cp311-macosx_13_0_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.11macOS 13.0+ x86-64

gllm_agents_binary-0.3.3-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl (1.6 MB view details)

Uploaded CPython 3.11macOS 13.0+ ARM64macOS 15.0+ ARM64

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.3.3-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 d3efa36e9d4685cefa08b23464acec08651423d05d1e8ac8d0015d0499c8c8e3
MD5 cba5d96d39fb8270d7629f4e2e3026c7
BLAKE2b-256 5ecd226bff8b2d011f59598940a3979f19a2141b98b84e8bdeefea12a1fec6f1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.3.3-cp313-cp313-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 edfdd2c42a0fd712f6a7d187d3050ce777fd133c5817998e29958e83e16f24b4
MD5 5dc732a9e4016341725f904d107bebcb
BLAKE2b-256 70b0f362df7a96b6478a76a7e1f1225a8c46f3d534d5f7441750cfd25f086767

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.3.3-cp313-cp313-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 db829ecceed2874e5bfd9389382af50ac4378cd801739f972cd81dfe962a280d
MD5 52f9291e5bc08c97b00d1d000e0b57a5
BLAKE2b-256 d8f2d55082773908b259b63a2d29fecf5dcc361c9a0c94b54949356f8bd831c4

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.3.3-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 ba8e012d07b69313916c997ad9cf762380ab4a3ab087ae00357adbedafe3e121
MD5 027697234bc894809e7054bdc9885bb1
BLAKE2b-256 dc5790efa2c9c6295713a1e54b7b7ce151913ddb042071e697ce26850cb57a66

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.3.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 335dbb28c8648d7a69d3d26d8fd9cb62f653481b9c554d3e06254764a58784bf
MD5 4ae8ed17719841d86144aff13d5e4022
BLAKE2b-256 3144831ecefe7584e8d665397feaf96a474dc903c5331e3668ffc3b2ab73abab

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.3.3-cp312-cp312-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 c97ed218362105a1d5d00dfaf7eac9545b306601a2e23abc9eaf7df705e9ee74
MD5 95b6cc38aa2e89415d63f679ce15a7f6
BLAKE2b-256 a250ffc6c2beee8e50000aeaca7499e3bb36ba39e3c3604425a38c9fd10e57c5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.3.3-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 d7148694384395a25db28cb1f31b883b7d9fbcf03bb1ab97751e2721efb1273b
MD5 0cd85eecf4ce4a1a2c91e27c9a41743c
BLAKE2b-256 d8ed59266102b5928282423e5f4d58dcb0d07796852d5280c4389b7d0c67d86a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.3.3-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 a71d965679c25a3df5c249b8c8c8bea1c6e8913f7195961cfdf8c0128e8eea23
MD5 1a77ca26b55753b89ee8278808f2c494
BLAKE2b-256 9e05345b7220ec802f909e2b0b206eb172095c0634d86a03226649043e2aec98

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.3.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 6f5b89d10a0c6aa109d87e76addc1117ebd5237e95779398bcce8cccffd947a4
MD5 1da662a3c1eec56b2057df52a16307cb
BLAKE2b-256 4bc25082f334441d825790c78b9d79bc2caebca5a6093c892791064e7eb14fe1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.3.3-cp311-cp311-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 9c7605dd15f880c98367ddecad6e1e4dfdb9ebaa58e41500de9a5d09102fe82d
MD5 c645473afd208dcbd3d852bab2118583
BLAKE2b-256 b005acafabc4ffb428fd93241efc6332242352d61b5d61792f3d52697f9bb5fa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.3.3-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 1dc155ff636cbfccf1726dc0211bcf9f8ea27b1f5fdc5e35b248a7dbd9c9457f
MD5 78f92c9d473fb6b61620f8541c5ad655
BLAKE2b-256 2ce171e105d598ea32985d00abe77edf4ea83101cac32985ced714d1f692d0be

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.3.3-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 2f57c8a0d71b956cf78a86c7dc4a24534557dec5e0825adf32623b82be076a98
MD5 474f2375832d2134a5fbdcc05949c36c
BLAKE2b-256 2b6aa123970da3dc0895858b5a81545caad799d3c2b34a29e6ed2570cf49fcf3

See more details on using hashes here.

Provenance

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