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

Uploaded CPython 3.13Windows x86-64

gllm_agents_binary-0.2.14-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.14-cp313-cp313-macosx_14_0_arm64.whl (947.5 kB view details)

Uploaded CPython 3.13macOS 14.0+ ARM64

gllm_agents_binary-0.2.14-cp313-cp313-macosx_13_0_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.13macOS 13.0+ x86-64

gllm_agents_binary-0.2.14-cp312-cp312-win_amd64.whl (844.8 kB view details)

Uploaded CPython 3.12Windows x86-64

gllm_agents_binary-0.2.14-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.14-cp312-cp312-macosx_14_0_arm64.whl (940.8 kB view details)

Uploaded CPython 3.12macOS 14.0+ ARM64

gllm_agents_binary-0.2.14-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.14-cp311-cp311-win_amd64.whl (861.4 kB view details)

Uploaded CPython 3.11Windows x86-64

gllm_agents_binary-0.2.14-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.14-cp311-cp311-macosx_14_0_arm64.whl (939.4 kB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

gllm_agents_binary-0.2.14-cp311-cp311-macosx_13_0_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.11macOS 13.0+ x86-64

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.14-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 3483908c9de4c93a097fce09176704918574b19484b42a289f6e03e298379398
MD5 34b259eeb1dc3da1f76f182448e7fe5e
BLAKE2b-256 15176474aca8a69de1a517de11d0ca155fbed162a25c8445749299ac7562c4ad

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.14-cp313-cp313-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 3f1f6449c02f7c2620fe4e71f59924f2f0e012a88f0be785dcd5f8102b898834
MD5 409a06b365e88b10098f1e743e9eab37
BLAKE2b-256 df10b01df7828f7aec644fb3e608dab786fc38d3ce972793b6f850d47dd8c7b7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.14-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 55feb44937e8262c943fc3d6d13501fadb184836d19c7d54248c64430ad12565
MD5 2f01898809632933beec889ec0652b82
BLAKE2b-256 6fa1699b3b4f16a8980a0d85ec3db40c3c04c87d247ee93d832105d3a9bc6bc3

See more details on using hashes here.

Provenance

The following attestation bundles were made for gllm_agents_binary-0.2.14-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.14-cp313-cp313-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.14-cp313-cp313-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 9713ac591d9fda807de5704e02482d630ec5ee0783425ee278c760ca0f37c851
MD5 550cbe18ab463020d2783f5ee3dd6c2a
BLAKE2b-256 7592155a53fe84b5ef5874fc2961a80e273e8f7095f4216a4477d73b81a212e7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.14-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 05a8b30d83048f6be10b4fb53a9b2f644917546a0952df9fb0d810d81787744c
MD5 29a2fc09cac13954e85e19ae8bae4dbb
BLAKE2b-256 5977be53f8a36fa3fd93d7a2b52ae29dd32542ce5cd25c1e8603c7f41b67aef1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.14-cp312-cp312-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 f7992b8ded783a6cc77494a901e725b46fbadc4ed0700786d06c22f972646e09
MD5 bdf4f65cb651427ad314ae2687af98b1
BLAKE2b-256 d3c0363a787bb8dd533a382de952b9d00bae43385a0021776af37303f7a0aa71

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.14-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 1f6d09a5d7f2ab5e6a026ee2d196b94b5350d082955561ccbf9626881fa031be
MD5 3eaf45fd5814353ef6a29abdcecc236a
BLAKE2b-256 6d55135e9e3bb3295654f3331b4981cd50f18a51e3796f39284541780172948a

See more details on using hashes here.

Provenance

The following attestation bundles were made for gllm_agents_binary-0.2.14-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.14-cp312-cp312-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.14-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 fabccad189a957fad2e6b45919813c9786a4bf544c247e2017215ce83ee80666
MD5 e1d0ba1c28adac17745dda8d7c9ae84d
BLAKE2b-256 e430ae2fa71d5b8e5b62100410a5674b46e54d1413c42067f61ef3e032c7bc7e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.14-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 1586b7757d155a5835e40eb164bb459853b755368617abffb1d4d74e375fa4fb
MD5 005f2f0899ef9c223489b9965b8b2fa8
BLAKE2b-256 3468b3d05b10337cdf4260be4de3851fe3f10e02e946953de01a648d6070fb21

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.14-cp311-cp311-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 525a0d8641c5a3f8d8c1b197444f2dea11f4cb144d5f81b0c6c919c52efa4f2f
MD5 84503689bf14dcb3513b2a15ab7324a0
BLAKE2b-256 29ff2428eccc26c45995de0887cf84679a02262d3a56134fef706684bb36d61a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.14-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 36c8a6861784b50019042d8930fd4fab262788e49561bf2e55ca4e07a6a1754f
MD5 5cdcf2a38e4d936339b7704b475b49ea
BLAKE2b-256 ed28bac6d7c80df888a8c1f3c487ebf95e3506752a64dd597eaf9c7b2d8cd9b3

See more details on using hashes here.

Provenance

The following attestation bundles were made for gllm_agents_binary-0.2.14-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.14-cp311-cp311-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.14-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 f35b5cb0f709e4471e91a3d52cc7b1bdaa128a9b2234d192d5284c4b64c04ba3
MD5 33da49608429b995819c6ec350cd96b6
BLAKE2b-256 efb0d5f48028290c6a63142ef023f43d36ca5b905b88659bce2e9a0f5d2abc37

See more details on using hashes here.

Provenance

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