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 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.13-cp313-cp313-win_amd64.whl (836.3 kB view details)

Uploaded CPython 3.13Windows x86-64

gllm_agents_binary-0.2.13-cp313-cp313-manylinux_2_31_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.2.13-cp313-cp313-macosx_14_0_arm64.whl (938.1 kB view details)

Uploaded CPython 3.13macOS 14.0+ ARM64

gllm_agents_binary-0.2.13-cp313-cp313-macosx_13_0_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.13macOS 13.0+ x86-64

gllm_agents_binary-0.2.13-cp312-cp312-win_amd64.whl (840.4 kB view details)

Uploaded CPython 3.12Windows x86-64

gllm_agents_binary-0.2.13-cp312-cp312-manylinux_2_31_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.2.13-cp312-cp312-macosx_14_0_arm64.whl (929.6 kB view details)

Uploaded CPython 3.12macOS 14.0+ ARM64

gllm_agents_binary-0.2.13-cp312-cp312-macosx_13_0_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.12macOS 13.0+ x86-64

gllm_agents_binary-0.2.13-cp311-cp311-win_amd64.whl (856.5 kB view details)

Uploaded CPython 3.11Windows x86-64

gllm_agents_binary-0.2.13-cp311-cp311-manylinux_2_31_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.2.13-cp311-cp311-macosx_14_0_arm64.whl (930.0 kB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

gllm_agents_binary-0.2.13-cp311-cp311-macosx_13_0_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.11macOS 13.0+ x86-64

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.13-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 c88b14d57c461c0ffc8ed1e1657342014412efeae5eb1725e46d21ca18343cbf
MD5 bac8fa17a6369f7708ba0db17d031f9c
BLAKE2b-256 600eed3a30a41727133899991d8911299dcebcf2a0c144dede2f3b3c000d553c

See more details on using hashes here.

Provenance

The following attestation bundles were made for gllm_agents_binary-0.2.13-cp313-cp313-win_amd64.whl:

Publisher: build-binary.yml on GDP-ADMIN/gen-ai-internal

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.13-cp313-cp313-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.13-cp313-cp313-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 2dfe3287eaa524c5f12c6970bbc557189d7070558af38a3664225c911dae11c9
MD5 b5be31b60d69cabfdd9def1c1a9be401
BLAKE2b-256 3cf2a143611dda059e47d0a50b2850cadbbdcfc0f315d175f6a94e16bbf35211

See more details on using hashes here.

File details

Details for the file gllm_agents_binary-0.2.13-cp313-cp313-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.13-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 eb7e9b77dafa4cc5fe568f8c09d1b282d4fc165e3cebe074fc801c2b2e12123d
MD5 fc4c711a2b33cf524bce074256e0d85a
BLAKE2b-256 85b7881bc7b54aa3b9183bbd7deee7a2dc18bcd4d8030fba435b0cf5e3950102

See more details on using hashes here.

Provenance

The following attestation bundles were made for gllm_agents_binary-0.2.13-cp313-cp313-macosx_14_0_arm64.whl:

Publisher: build-binary.yml on GDP-ADMIN/gen-ai-internal

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.13-cp313-cp313-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.13-cp313-cp313-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 1ce23a3977670eba843bb46ffa4ab7e9d108f82761b4f55caf0d04f7d51697a5
MD5 4fd0ab98923dd4aee163804eeacd5add
BLAKE2b-256 678a4f49f13895533afcf3928645e9c41d16a53aa26ca9945168e64b8982280f

See more details on using hashes here.

Provenance

The following attestation bundles were made for gllm_agents_binary-0.2.13-cp313-cp313-macosx_13_0_x86_64.whl:

Publisher: build-binary.yml on GDP-ADMIN/gen-ai-internal

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.13-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.13-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 03df9587dae9375fc834ffd3821a21e16c37c33d789e3695e9da78e906f4b1a7
MD5 b6f1f897d9f9c1f3661ff35621566118
BLAKE2b-256 5141b3830be5180285463886dc1245e2a68efaf96164866dbf31aad547ac49c3

See more details on using hashes here.

Provenance

The following attestation bundles were made for gllm_agents_binary-0.2.13-cp312-cp312-win_amd64.whl:

Publisher: build-binary.yml on GDP-ADMIN/gen-ai-internal

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.13-cp312-cp312-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.13-cp312-cp312-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 d45f78da719ad5e6b34c33041f80bdcc1754feb2bc78704481c07fd12a2a9a00
MD5 0d972ad89b8a007bdd5168e4aa8dd997
BLAKE2b-256 695ad119c5bc6b5ebf1e6b7f255ddff8840e134b191814c4c837f1167bc17052

See more details on using hashes here.

File details

Details for the file gllm_agents_binary-0.2.13-cp312-cp312-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.13-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 cd584a5eaf16bbc223a6b95b101e4b3c779b32a4bdc7cda65779473cd4f98a66
MD5 083273127bc3972b67649626af4a6f45
BLAKE2b-256 90c964e4bb0c40706c098deaf6400d3a1de75863f39c25510673eed7f11f50ef

See more details on using hashes here.

Provenance

The following attestation bundles were made for gllm_agents_binary-0.2.13-cp312-cp312-macosx_14_0_arm64.whl:

Publisher: build-binary.yml on GDP-ADMIN/gen-ai-internal

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.13-cp312-cp312-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.13-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 0b7be0cd00957c3aa088dcd98877d9ea3d621ff3cf06518373d50afa558ecf85
MD5 98d431ce4d1bf37f416e2d37c6c7f08a
BLAKE2b-256 e11c3d5c59f6b97a618aa8f914708e5ccc93fc7bd93ac1406163396870ec9ed4

See more details on using hashes here.

Provenance

The following attestation bundles were made for gllm_agents_binary-0.2.13-cp312-cp312-macosx_13_0_x86_64.whl:

Publisher: build-binary.yml on GDP-ADMIN/gen-ai-internal

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.13-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.13-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 50f66b917fb959b978cc2bbc5a79b6a7cca0b3c25eef697c9fcadd7b6ab81123
MD5 a112ebfbd81309cd5637d431072d6a8b
BLAKE2b-256 fa63b57700edb3b4413cd15ed3d45a2511317cbaeaf793f35ed649a6c4fc6105

See more details on using hashes here.

Provenance

The following attestation bundles were made for gllm_agents_binary-0.2.13-cp311-cp311-win_amd64.whl:

Publisher: build-binary.yml on GDP-ADMIN/gen-ai-internal

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.13-cp311-cp311-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.13-cp311-cp311-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 13ec20cc519d3405725ad957f7820fc9e8d93b81fa860e3a1c9b9479ce072cba
MD5 67e27da57bb76b69be1039c5c01d693a
BLAKE2b-256 9e4e067db48b2548b1dc30f9757ea5895caf83b348b8f2c8b8a019a447f8a058

See more details on using hashes here.

File details

Details for the file gllm_agents_binary-0.2.13-cp311-cp311-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.13-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 e67d37051e3de005e2733846c9662d31aed9957d20ec45b44b5bb9cc22579cca
MD5 417aeb2f66318763736f51fcad251339
BLAKE2b-256 f97ec05866c02e1b48489612b1d7d9b729298ee27dbab48ca0741305a3c25f76

See more details on using hashes here.

Provenance

The following attestation bundles were made for gllm_agents_binary-0.2.13-cp311-cp311-macosx_14_0_arm64.whl:

Publisher: build-binary.yml on GDP-ADMIN/gen-ai-internal

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.13-cp311-cp311-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.13-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 7a59037f3a7128b16d023d79ea3c8037038ac5e15bc7d45e377c35579f97ac9c
MD5 20f4a423e95dad8cd5220955725a059f
BLAKE2b-256 611afee4122f56190d997565dbcd8271ef46b4a0299429311f7d3d96b4896bb2

See more details on using hashes here.

Provenance

The following attestation bundles were made for gllm_agents_binary-0.2.13-cp311-cp311-macosx_13_0_x86_64.whl:

Publisher: build-binary.yml on GDP-ADMIN/gen-ai-internal

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