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

Uploaded CPython 3.13Windows x86-64

gllm_agents_binary-0.2.32-cp313-cp313-manylinux_2_31_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.2.32-cp313-cp313-macosx_13_0_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.13macOS 13.0+ x86-64

gllm_agents_binary-0.2.32-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.13macOS 13.0+ ARM64macOS 15.0+ ARM64

gllm_agents_binary-0.2.32-cp312-cp312-win_amd64.whl (1.3 MB view details)

Uploaded CPython 3.12Windows x86-64

gllm_agents_binary-0.2.32-cp312-cp312-manylinux_2_31_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.2.32-cp312-cp312-macosx_13_0_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.12macOS 13.0+ x86-64

gllm_agents_binary-0.2.32-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.12macOS 13.0+ ARM64macOS 15.0+ ARM64

gllm_agents_binary-0.2.32-cp311-cp311-win_amd64.whl (1.3 MB view details)

Uploaded CPython 3.11Windows x86-64

gllm_agents_binary-0.2.32-cp311-cp311-manylinux_2_31_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.2.32-cp311-cp311-macosx_13_0_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.11macOS 13.0+ x86-64

gllm_agents_binary-0.2.32-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.11macOS 13.0+ ARM64macOS 15.0+ ARM64

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.32-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 df78282a5e4c2322acdc35ea1e1301f2e2d5ec651be379a3997f96ff93c68492
MD5 e7685f461d48af8649577ced63fb556b
BLAKE2b-256 d60b7b70041302bcdd644226e28c92acabee92b13e15a64ea905964e31e6d605

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.32-cp313-cp313-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 f04954db27f5e793886e7e68ba4ed2f730a8db03e2bc07a934e5ace7fca30179
MD5 2512330274d340391bcd0ec9d3df3eaf
BLAKE2b-256 70d484c793b13035a20a7a9b547f039d591e6fd13572312005edd6ab231958c8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.32-cp313-cp313-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 8b748ada8621b62a7133fdd51bf19ff3ad9ad68c78e776db0c4cf0d200c05dc2
MD5 6373c0905286b769a4b71a3ad1dbcc6e
BLAKE2b-256 9c3aa234bd47ef850548c89fc4e567f1ddacc5ffd20578087c76b2a1d189de56

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.32-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 53310841bc8744fea79eb430b3dcac8848179bb63f6b36f693d70c505b126fc5
MD5 f039c42139d51ffcffca60ede2fa343f
BLAKE2b-256 6447308e7b8598e4c3234008e041b34471e3f343b8997ba3ff4e54151ca7f944

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.32-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 191a6ca517e11051fe59d4ccf7c23e601fb2724f994e7020faf8ae23bb2cb7f8
MD5 0495e13c81c7e81ad79a981f229802e9
BLAKE2b-256 e20c61f86199cd51040057fd41bd5d72b0b10015051681a1aa60320aa7246c51

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.32-cp312-cp312-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 96fa302c09ea3608f8e40eea0a38a3dd6269f82d23ec6a4a731b4b9347c3ba46
MD5 114ef00821d7847e8642996a36dc312e
BLAKE2b-256 98809b3319c4b5150e40ac43c9792feaf3deb81992cf57f5fd39bf822e1607e2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.32-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 2c3022aa87fe28fdc95190445ab6afe053b34b2eb3951b5f69d73865a1ae4bf2
MD5 825296c5103dba18c3eff5ae14e284b3
BLAKE2b-256 e82753574f1375559fbd9bc97805b23337ba65c241df0f458e6d03a14afe733b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.32-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 38f062432095a25fe0ce6908266e2e15a0f1d01dbe676c494289c214c450bdef
MD5 1c2db5a70cdb6426615e311b1ac9d6eb
BLAKE2b-256 9c82299455b71dbda8c33ffbfdf7f3f461d0c9a918fb5f9ff44ee9d6c3c6a5be

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.32-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 08e748ee763fd80c7423d912cf945ecc99867237bfeb5f9e8be531bf0ac70702
MD5 394b3a8d5c34d196c26f89f2fd01a8a8
BLAKE2b-256 2231a16e209ee51ba7ccf334fbb5616c5e3b8f35a491b26ae2250d6fcc4bff94

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.32-cp311-cp311-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 40853eae823deef8fb6856b573af6eb5b48403484a89560740ecfe1b4c02574a
MD5 3ebbb42d73aea2bc4ffb1fc3400b0f02
BLAKE2b-256 2454b511137f64b1faf5898fc178d1368810652c91397be8272d82c547fed4f0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.32-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 4ebbce2aecdcfb2d77bd0cb38708fd0f5fca0dbcb372c91ca0f66dc26d645225
MD5 fb8d9f4d9229636fd2ef7c561fa07070
BLAKE2b-256 afa72010a06705c964b0fc129e51f640bd6a5dee4ff67c263d35800b92d1ed51

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.32-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 d239f235642bc68f019712425227ee4357ced588b223668f072092564f6e7157
MD5 c4aad9a7e6d3f2965b06c5bdefd39b32
BLAKE2b-256 f1b1ca3ec466dc31b42303067c26e3d6781dc88b973b6181bf91eb216b88f5ca

See more details on using hashes here.

Provenance

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