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

This version

0.4.2

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

Uploaded CPython 3.13Windows x86-64

gllm_agents_binary-0.4.2-cp313-cp313-manylinux_2_31_x86_64.whl (2.6 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.4.2-cp313-cp313-macosx_13_0_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.13macOS 13.0+ x86-64

gllm_agents_binary-0.4.2-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl (2.0 MB view details)

Uploaded CPython 3.13macOS 13.0+ ARM64macOS 15.0+ ARM64

gllm_agents_binary-0.4.2-cp312-cp312-win_amd64.whl (1.8 MB view details)

Uploaded CPython 3.12Windows x86-64

gllm_agents_binary-0.4.2-cp312-cp312-manylinux_2_31_x86_64.whl (2.6 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.4.2-cp312-cp312-macosx_13_0_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.12macOS 13.0+ x86-64

gllm_agents_binary-0.4.2-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl (1.9 MB view details)

Uploaded CPython 3.12macOS 13.0+ ARM64macOS 15.0+ ARM64

gllm_agents_binary-0.4.2-cp311-cp311-win_amd64.whl (1.8 MB view details)

Uploaded CPython 3.11Windows x86-64

gllm_agents_binary-0.4.2-cp311-cp311-manylinux_2_31_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.4.2-cp311-cp311-macosx_13_0_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.11macOS 13.0+ x86-64

gllm_agents_binary-0.4.2-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl (1.9 MB view details)

Uploaded CPython 3.11macOS 13.0+ ARM64macOS 15.0+ ARM64

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 e7517e60e1d24a3cf4fe0cb533129c81ebece5d0828b58ab69a3e387700d8006
MD5 7aeffad48a5df898751a5b6991124e58
BLAKE2b-256 8ea41e979915f0072a7fefbec75996710eb78f0360224127545bca26189bf2bb

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.2-cp313-cp313-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 71b72f056268d0d1f7385650f3499d938fd0860938dde2bd14fb0eee29de93d6
MD5 116f9f32846a66c4a27e36ebb72ab37f
BLAKE2b-256 646e2c54168f0090b7d6626b8ab317d7e3e306fbf37b2ffa7f50ef3e891546e3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.2-cp313-cp313-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 af24d8e21caccb014403c901cfb676db6af133a48f9848f2a69dd9095375fa68
MD5 9f34fd6f70f0ba3719b1262e78295873
BLAKE2b-256 ed4dee6df88c72923b5ab34737187f93f95065190476ef018025f0972f32671a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.2-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 03554c5dba9a4ec8808db3663060928a9c9a4d73ccdfb8161fd58a1c29a890ce
MD5 88bc5c8cce1c013dd890fea38e7bfc71
BLAKE2b-256 a3c9565841e19163fb6c0b8a4d5bc9381c1c73d836eb1087867ecebc9573e079

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 6fd52471adf65b5ca5f49f19a6a801910cc4791b23e0887ba1e68b19741a2328
MD5 0a56154b9989126572d7b50e03065d6d
BLAKE2b-256 e0fbe5fab604f0b560f778a34bc54beeac2d3b1d566738e331933158c072758a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.2-cp312-cp312-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 2e8deddcfe63c17d955459cf716879e22ea545cc160593801fa0ff0e6956a3f2
MD5 5da7d5bd295f8155337a2b9204a3dd2e
BLAKE2b-256 03fbc17d3a00c5e077e9920127f15d71765819246334096a72cc407be6daafdf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.2-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 95dafaaa1df0c1f151caf3a164e03582183476bda171b2ddb3db235215bc570e
MD5 975cdcde0dc71824cb8b30f1718a0e29
BLAKE2b-256 d34ca6f3673e31ed98e621d6bd7a917acc050e8014f8f87f2eba28e529f4f076

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.2-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 89a2e4cafd5a96b13410200a44d580a79f0646cdc8b86b815c17bc2441b21411
MD5 d16ccada882b755280b5a8c838b78298
BLAKE2b-256 b15f9d610c4cd7ef4613f02c54d68f8d5b91be0698943d602bec19b48349788f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 85ad968a07e0987da0b56fcbcef35a41453f5496839f0d7597e63f1d03200266
MD5 d819324ca1dcbc6c23e18aaa8d4f36be
BLAKE2b-256 997c2b45de5cef186f3dba8c8e1951f1c63a2c89fb7af0b63b975b5a85ea7082

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.2-cp311-cp311-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 a5537609f5a3742a2a57f7dc453531b43395fbda789bb6cd402a9106eadc25de
MD5 dcb7eceda7d84343addf3ef8f222c15a
BLAKE2b-256 ed67be393d731522186c2ad1d3df82616d07c5b280db6f28eec568038f09be4f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.2-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 2858d6e9fe0b31ef1e95dc155f2e457fd54e42c7e523f78398f6363559d8fded
MD5 d690c6d3e81296056b9f3a9bd8de5559
BLAKE2b-256 02f392918e8aa0cf60d905e3a74207b8e65ea3af18d700592280276721eb5d4c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.2-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 4a4add40f45bc1a1829bc8feacd806bd2116ea8776be353d3f860b34b1c34360
MD5 549ad6530a7b7b87f8bf8798ba553e1a
BLAKE2b-256 9a4cd77f6ec82a82cecd45a7a2cd7157e73c6922d3cf15ed65b86e3d269b4149

See more details on using hashes here.

Provenance

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