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

Uploaded CPython 3.13Windows x86-64

gllm_agents_binary-0.3.6-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.6-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.6-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.6-cp312-cp312-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.11Windows x86-64

gllm_agents_binary-0.3.6-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.6-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.6-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.6-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.3.6-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 a771044ca122d3da7a74e360f2466dca61ebbd18c5488c1b40e51ad0883629de
MD5 dfcefd9150d539384306d95b20aaae82
BLAKE2b-256 d890ae4a90f4784002f569258d3e9983d5a4201f3c85b9fec874c4df5ce0bc6c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.3.6-cp313-cp313-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 213e636bb49a7a9ef65e28a41d84ab029b45fb2f2935e977a411b47b29da9191
MD5 d5b3be3dfef24e7f09d5f5982579bb14
BLAKE2b-256 c42639a263df78a24acc92c75f1141df6a1b20eb07957e7afbf6aefc0a0b8e24

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.3.6-cp313-cp313-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 a408bcfa299f3a1274455b9b3c66cb040df7c1841408be25817a674fb13e3fa2
MD5 2fd9740671c8378067f539ed0684f42a
BLAKE2b-256 bd92fdd379569421e1431f7cb4c30010babdb309664878393a3a0695543deba8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.3.6-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 7a95bb93a2b3d3af81aed4aa4c79c6d5dd5e55b5744d8aa8d308214eba227325
MD5 ba2b4ff3baa6c7511f5c9a16348b10ef
BLAKE2b-256 3b388825792cec2efaa1c22ea9d339eb57f3b37e8cd9590c803c32e2b5ccda91

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.3.6-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 6c4e107375f7e96bb1f76e9562d1e1c2e479ed0edd37d39b79bf1c3a2c8f4218
MD5 410835d8b59f9e29e3542372b501f146
BLAKE2b-256 42d869d65f38d9a70a8f6f6fea47cb8753dd13d5ad094fe0817bdc772f3562cf

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.3.6-cp312-cp312-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 301d19dd2ad6ff4fd32737abd37be5a18a850170c993da4d82a13461c2e7b3a1
MD5 8d70ba249db12305d3533d1fa40208f4
BLAKE2b-256 4ae6d151735edfb99aa9654977c404294403891364da2ed57f7a0e4231d33992

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.3.6-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 92936fe37c2a16ea02ee6383f433f613df1294f317f5d4e7f502dedec2eeea9d
MD5 a6ef0055a20b837e1e917756cffd2853
BLAKE2b-256 328d0a97796bbfd95ae1369b60f2a9fd47efe36105ba6ae16e4f1150c90e9c68

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.3.6-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 7913d90d49ccd0ca510bb47d49314be02b65f8828479cdb35a74aeca64579a2c
MD5 637a13ff25038f4b2d565d1cf3a40c0e
BLAKE2b-256 3e936126126b251844a360ea4808db9baf42b0ff1f5cd03a4646d18162ccc3ae

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.3.6-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 fc8aabb4eefb4262460671edf664bab19ff6549479b1e3d1ccfab09d5c27a079
MD5 dd1b3dfa5c6ee6f1b19fc6aa1fb32fb1
BLAKE2b-256 9d5602dbd347a65d6b492f1f3e63ee194f5b82291c43b70ff52bb3ce3b795110

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.3.6-cp311-cp311-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 1f81410e42dc958acd9e31d69cb2efe176263f58c6a0fe02c260bf31edb8f76d
MD5 2a0b6102e51ed32302891e255bc3bea9
BLAKE2b-256 41cbb0100f2620320376f021f48b8d6bb50016a6cf2e06c9dc9e6f4ce1bfc93c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.3.6-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 4f86378087d96af3fcca9376df854efcab0f9303d1455eb396fa1f13ac05f2fb
MD5 75c0f89b9375d937e9fcf6a94dfcb159
BLAKE2b-256 9c3cb63547331dfa46c5d54dcfec2348683178515f9a32cc5c0a359b1a828117

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.3.6-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 2ab372cb89be46433652c1f91f93951abb852dc1b1ef3aed539fbbc470f8ad16
MD5 90423f0db36ee51d402196241f717bb5
BLAKE2b-256 a3d4de958d5ee2f4f9e11e9ec3929e0af4205b140a0d58c7520918c155ea16ac

See more details on using hashes here.

Provenance

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