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_a2a_multi_agent_coordinator_server.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.

aip_agents_binary-0.0.0b4-cp313-cp313-win_amd64.whl (1.9 MB view details)

Uploaded CPython 3.13Windows x86-64

aip_agents_binary-0.0.0b4-cp313-cp313-manylinux_2_31_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.31+ x86-64

aip_agents_binary-0.0.0b4-cp313-cp313-macosx_13_0_x86_64.whl (2.6 MB view details)

Uploaded CPython 3.13macOS 13.0+ x86-64

aip_agents_binary-0.0.0b4-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl (2.1 MB view details)

Uploaded CPython 3.13macOS 13.0+ ARM64macOS 15.0+ ARM64

aip_agents_binary-0.0.0b4-cp312-cp312-win_amd64.whl (1.9 MB view details)

Uploaded CPython 3.12Windows x86-64

aip_agents_binary-0.0.0b4-cp312-cp312-manylinux_2_31_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.31+ x86-64

aip_agents_binary-0.0.0b4-cp312-cp312-macosx_13_0_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.12macOS 13.0+ x86-64

aip_agents_binary-0.0.0b4-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl (2.1 MB view details)

Uploaded CPython 3.12macOS 13.0+ ARM64macOS 15.0+ ARM64

aip_agents_binary-0.0.0b4-cp311-cp311-win_amd64.whl (2.0 MB view details)

Uploaded CPython 3.11Windows x86-64

aip_agents_binary-0.0.0b4-cp311-cp311-manylinux_2_31_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.31+ x86-64

aip_agents_binary-0.0.0b4-cp311-cp311-macosx_13_0_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.11macOS 13.0+ x86-64

aip_agents_binary-0.0.0b4-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl (2.1 MB view details)

Uploaded CPython 3.11macOS 13.0+ ARM64macOS 15.0+ ARM64

File details

Details for the file aip_agents_binary-0.0.0b4-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for aip_agents_binary-0.0.0b4-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 5bfab134ecfd0bb127dc2d325a8fbe2c70bb1be588fbecb506df3320fc260fbf
MD5 f2779b4af290b45f5adc2c59167bab14
BLAKE2b-256 41ebf4c87fec640c751fffd6b9ae829474a4ebdfe6b42f733dba66a2299ce840

See more details on using hashes here.

Provenance

The following attestation bundles were made for aip_agents_binary-0.0.0b4-cp313-cp313-win_amd64.whl:

Publisher: build-binary.yml on GDP-ADMIN/glaip-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 aip_agents_binary-0.0.0b4-cp313-cp313-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for aip_agents_binary-0.0.0b4-cp313-cp313-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 3b0d39c0a54940459b2c2a8511d98a2c8e23f522bf2394c8367d1831d0ffb094
MD5 ebb57c25ab81cc0648f3cd98c7791ade
BLAKE2b-256 2c25f0720235643be1921b65c000b07d051270e9e6ac05b94ee9fedfc62654f7

See more details on using hashes here.

File details

Details for the file aip_agents_binary-0.0.0b4-cp313-cp313-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for aip_agents_binary-0.0.0b4-cp313-cp313-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 656c2118319d40a8eed47d6f6364099355a5c2ce2a4c8a08d11b30d992c1c643
MD5 057c443a59bb9deea729ae8f45f8b496
BLAKE2b-256 264f8727f31a59f8a4011e7035ad9d0a64ad2b9a41d8bcf1adf4c49d24a9813e

See more details on using hashes here.

Provenance

The following attestation bundles were made for aip_agents_binary-0.0.0b4-cp313-cp313-macosx_13_0_x86_64.whl:

Publisher: build-binary.yml on GDP-ADMIN/glaip-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 aip_agents_binary-0.0.0b4-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for aip_agents_binary-0.0.0b4-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 11baca5362826de449dff0cf96cfa78029d5ac55a7da311927b6b1fde36e2d5d
MD5 9fb34a8b4e047381133ac51e01fefed2
BLAKE2b-256 f3cdc18c7435f86f2b75aac5bf130e5a53014075d592c68a54c08c0ad5095d1a

See more details on using hashes here.

Provenance

The following attestation bundles were made for aip_agents_binary-0.0.0b4-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl:

Publisher: build-binary.yml on GDP-ADMIN/glaip-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 aip_agents_binary-0.0.0b4-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for aip_agents_binary-0.0.0b4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 7aa4191b0e1fe6d12bfe276a96c7dea88d49de758f3aaa05f777475a96f9f584
MD5 0f016ab3a141d935f36bc539bf314e2a
BLAKE2b-256 9544136d73de79a3feb195cd750448f5c41cc02c019c4934020c911f677f88b2

See more details on using hashes here.

Provenance

The following attestation bundles were made for aip_agents_binary-0.0.0b4-cp312-cp312-win_amd64.whl:

Publisher: build-binary.yml on GDP-ADMIN/glaip-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 aip_agents_binary-0.0.0b4-cp312-cp312-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for aip_agents_binary-0.0.0b4-cp312-cp312-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 d94c3d3cdb429a89268398ad42a00d175990677215e6377c37be86e0ecc54f4a
MD5 9e2cb9510b7f90458b27de1dbd19d99f
BLAKE2b-256 69fd7bb3e50db6f3edd56b5f1bd3adf351ba7031cfbaf21c76f7da0476469bd0

See more details on using hashes here.

File details

Details for the file aip_agents_binary-0.0.0b4-cp312-cp312-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for aip_agents_binary-0.0.0b4-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 ff48f576459cb11bbb99cc442fe71a7c644dbc41400c397dc3df67bf9780c340
MD5 c9b09aaf8ec39f5cc109df0e07c08b3a
BLAKE2b-256 278b0c3173de12b37cd66fe047cba4996684d0320a67276a170acf25c55d5fe8

See more details on using hashes here.

Provenance

The following attestation bundles were made for aip_agents_binary-0.0.0b4-cp312-cp312-macosx_13_0_x86_64.whl:

Publisher: build-binary.yml on GDP-ADMIN/glaip-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 aip_agents_binary-0.0.0b4-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for aip_agents_binary-0.0.0b4-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 6b6d19964e2cad6bb9e99cb9ea195d0478223b723251e974ca3e276d870baa3b
MD5 168b062f68338560c10264fc144d2e44
BLAKE2b-256 47c49f679c58db5deef72bb5285ed055a3b54fcc360969c29682cbaf3b21bcb8

See more details on using hashes here.

Provenance

The following attestation bundles were made for aip_agents_binary-0.0.0b4-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl:

Publisher: build-binary.yml on GDP-ADMIN/glaip-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 aip_agents_binary-0.0.0b4-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for aip_agents_binary-0.0.0b4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 297db573d3e64a8ea70eab0c10c04885f1be958e47c8f4ba615342c77e25e9de
MD5 8a60879fb97d1a76f79d61d1a9371387
BLAKE2b-256 dcced1bd73093efef793703929b6f61d358b47a15a75e5e83e5d53c19c477478

See more details on using hashes here.

Provenance

The following attestation bundles were made for aip_agents_binary-0.0.0b4-cp311-cp311-win_amd64.whl:

Publisher: build-binary.yml on GDP-ADMIN/glaip-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 aip_agents_binary-0.0.0b4-cp311-cp311-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for aip_agents_binary-0.0.0b4-cp311-cp311-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 3f39ee34cf0e4669ab071b26522432e658f872173dd27c82b572534354ae1e3e
MD5 c3607221799166c75542c27dafdf27d7
BLAKE2b-256 6ea20897f2db20403a2085eac26ba73f2fffc279a9bfd228ffd9b7668b485237

See more details on using hashes here.

File details

Details for the file aip_agents_binary-0.0.0b4-cp311-cp311-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for aip_agents_binary-0.0.0b4-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 2b3fea64b452be2c329dcfe291fffbba5335db88ba9b912012bb0d0481280d85
MD5 60eeae7b9f37ce00cb4ea6f518dfe7e9
BLAKE2b-256 48f76c7a399921f4355ef74f9bb490c2de1a9204f7eb1a96137ae26aafb03272

See more details on using hashes here.

Provenance

The following attestation bundles were made for aip_agents_binary-0.0.0b4-cp311-cp311-macosx_13_0_x86_64.whl:

Publisher: build-binary.yml on GDP-ADMIN/glaip-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 aip_agents_binary-0.0.0b4-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for aip_agents_binary-0.0.0b4-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 9598742cc5d123136fc3139490a7fe34f6f329c5cae1f7fd202cb9332adc301e
MD5 8424c4eedee2c1893fc0d7edcbd3e5a9
BLAKE2b-256 5a9e488b91e237b8d4e60d02585a419c45167b827ad1896a387a87781837e164

See more details on using hashes here.

Provenance

The following attestation bundles were made for aip_agents_binary-0.0.0b4-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl:

Publisher: build-binary.yml on GDP-ADMIN/glaip-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