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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.12Windows x86-64

gllm_agents_binary-0.3.2-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.2-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.2-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.2-cp311-cp311-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.11Windows x86-64

gllm_agents_binary-0.3.2-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.2-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.2-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.3.2-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.3.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 2ba984865a5e02b5c15ff23995f9fa13e41fba38b1ca368c38f74e2c091f8451
MD5 98ee7e7630755fb5f6257409b7a02710
BLAKE2b-256 e5c504b537b43b1da3959aebda4cd43722deea36e467888d3bbbf5d71150a811

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.3.2-cp313-cp313-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 9c894cc8948653b53463fe5ad4bad4ebd6c257f0b6a639bb1fd0e2f30f98b0bc
MD5 940e9ebb3012f9b19191c92589a221ec
BLAKE2b-256 c75aa66a0815961b77fdf89b595a3ff92c0b2ecd7ef2aabba4fd43a03ce726d7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.3.2-cp313-cp313-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 85ae0f36452965bc966d28e1c5e2f99b7627989ef9f0cf9b5e5be4ae67292b74
MD5 cee3097126ac4135fef887f8b6bf7f19
BLAKE2b-256 bfdff4ece4e54b8f70bc0fda486aa451a56337f275c9c8ca1634364bafeead5e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.3.2-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 7c627e0aa84833b2795204f25c8d31e8010461eb152055f6f0a4987da925e42b
MD5 433437b3b8b81dec7d2a4d3871cc7957
BLAKE2b-256 251b573a08cf06f6cc16d3a6cd9736443917a6df032ad489000e481c2f50973f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.3.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 0a969a39ad05594722670e996c1e2fdeefb80583f26e97a09579f0cfa813038c
MD5 6fb715bfa3daa683731797ca184009e8
BLAKE2b-256 fa2e08598ad9654715649b68f096403cccb821a664b2767763d2cfd1ec069188

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.3.2-cp312-cp312-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 d23e6f5183b48ab0301e1215f392e509a7df546383b54a016ee6758a5c665b27
MD5 d8703124e65eeff4e8dc5e9779be883c
BLAKE2b-256 dfbf5f7021f57f8e9299fcfbda133cf8aea99c3aaf842c10787fe17ae26db047

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.3.2-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 0f210117acffbbb6b891c83185f8e4f07fb50ad1e7791293ae0f327b3f2c00f1
MD5 87b82f152d8c0c5dfe3ba799afb2bf95
BLAKE2b-256 0803efbc36c75227fd2e067d95ca14df9b79f4a249af258d75df55c3997d5d8c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.3.2-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 335f00f1c1b13d800280152011aa2e641e364e2270b8bc4f7da0db306f3571f6
MD5 ede99a2fe69832fcaa97042c2ce92974
BLAKE2b-256 f4946b9a795cf0969ad814799b83613c14c9cf8d9d91dfb690b4efc1b80508e3

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.3.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 8ba7eab1b76d3c7147560a7dbc785f41702c143f1bd14bd71bae9fd78d36feed
MD5 7cd48d8211cdd5d8cc2d5bfe68c85fc9
BLAKE2b-256 5d98ba755c298d3345b78c299f6a3752654166c844e8a055eaf30a21b64055a9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.3.2-cp311-cp311-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 1ddfe0a86240001829f6f6c15a5adfe2d44ec1389c2e2fbdea2c8012df97c104
MD5 0f225cef590bcc27c60a6acd825836d2
BLAKE2b-256 dc06f733f3cbb87282f3e00a628c691f639df0a05ddca86d83a63fc4f38bf266

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.3.2-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 0fb58de8479f61d767104b4031718d53011df180f2595ca3ef018c45df75dd3b
MD5 9c52864e2e59616adbeb2d98d76e2990
BLAKE2b-256 be3f3eb0f051c2e046e980e20172f5c6be3cc9f94db8b961e1dbe83e7e311ddf

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.3.2-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 4c4203461dbad2d52800ec631a191b80f3180b1611882bf42c7ecece378dd387
MD5 3be1db4c5379c194715d0b4e31ec9836
BLAKE2b-256 5d35d7ad3c05fb6b81aab2152503cd6e48dd58249d22456db0236b29e786e0fe

See more details on using hashes here.

Provenance

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