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.

gllm_agents_binary-0.4.14-cp313-cp313-win_amd64.whl (2.0 MB view details)

Uploaded CPython 3.13Windows x86-64

gllm_agents_binary-0.4.14-cp313-cp313-manylinux_2_31_x86_64.whl (2.9 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.4.14-cp313-cp313-macosx_13_0_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.13macOS 13.0+ x86-64

gllm_agents_binary-0.4.14-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl (2.3 MB view details)

Uploaded CPython 3.13macOS 13.0+ ARM64macOS 15.0+ ARM64

gllm_agents_binary-0.4.14-cp312-cp312-win_amd64.whl (2.0 MB view details)

Uploaded CPython 3.12Windows x86-64

gllm_agents_binary-0.4.14-cp312-cp312-manylinux_2_31_x86_64.whl (2.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.4.14-cp312-cp312-macosx_13_0_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.12macOS 13.0+ x86-64

gllm_agents_binary-0.4.14-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl (2.2 MB view details)

Uploaded CPython 3.12macOS 13.0+ ARM64macOS 15.0+ ARM64

gllm_agents_binary-0.4.14-cp311-cp311-win_amd64.whl (2.1 MB view details)

Uploaded CPython 3.11Windows x86-64

gllm_agents_binary-0.4.14-cp311-cp311-manylinux_2_31_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.4.14-cp311-cp311-macosx_13_0_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.11macOS 13.0+ x86-64

gllm_agents_binary-0.4.14-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl (2.2 MB view details)

Uploaded CPython 3.11macOS 13.0+ ARM64macOS 15.0+ ARM64

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.14-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 e0fbed69ae392d9715bbba36471711c2331d266b299965aad017fce6ddff455a
MD5 31f2cc4ef3395879fa35365cb8670fff
BLAKE2b-256 f2a5dc5514e9ae7d3e2408edadf729565ef786fcd4429f5146d334b380f62271

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.14-cp313-cp313-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 0df9e753b80f5836a6ab1398ae584bb5fe79442d88a72b0d0be03e71d98f6c8a
MD5 2a6ea3ac71857e223c8cc929bd381445
BLAKE2b-256 122fa7346bda53deebff76e55a405ebddec1b16b8c5b58a70efed0056cb315df

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.14-cp313-cp313-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 d6dd92837273c2f4c255ace4b336c5af6ddf19f5f08c776b644d2f4ee7734dae
MD5 8f573ae46182e71458389774c5db1ff7
BLAKE2b-256 68f1e9d20db8000b6258dd344f9a16806d613b9758ae1d4eaec85d7e78ddb72b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.14-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 19c376a74764ef308a127c8f88cbe9d55d9ca639b9d2a32c168cf4fce5b76126
MD5 6a114f3e290780acedab35e68f56975d
BLAKE2b-256 3e72e8e300bd380bcc42ce709a254282552d55bc52e76a1d3749297605342cc4

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.14-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 d2b842e0c1b1d9a0d981b35e68d755167bf8fbaaada95f5a4c20774ee69b133c
MD5 65c0eff1fe89db414713d2873411f310
BLAKE2b-256 db2ab9c4b64605c6bcff3bc006345705f2a7e49de8fa23b341f129878e74fc7f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.14-cp312-cp312-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 b735a0865cdf7ba0f83d2f132c8104e7c2638dc9d952912973ea0cb341ba0e8d
MD5 85cbb87fa87f2ef452d516aa0c961e96
BLAKE2b-256 80dd8818283a0fe1ea0cc9d80b345a0f0cdd0b7f08192d066fa0885324e263cb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.14-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 064eabac31291d7fb09f326157325eb0123e0c95bd76e2c8dd3d6da0d5f6e65d
MD5 58a4894a478c74c55d101aa70a8e95ba
BLAKE2b-256 52a87de23da4cc03c6c69916aba0eb5e4f41162750ffeb19bb8af3c61b86bd98

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.14-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 9d6542f0e1ca0d965214c54f79f2c9327c7f789ae9fa26a2e9265dc516ad6a2e
MD5 a5e3e74834006131e993019006eaae77
BLAKE2b-256 c95f02667f83bd717ba4bc5000f39792ec82e39c7d3fa223bec4043381727f90

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.14-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 8e2acb9325b44e16f367ee0cf5ecfa5e1fd0f9e539f26ea9943dcb37dc8600e7
MD5 2b07749e611f45b1e72f71e7f3c5d8d3
BLAKE2b-256 6fbbc02445e08fdb2e6d99ce6ecc0973776411213a0a2bf0370f091daeb1a666

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.14-cp311-cp311-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 5f07eff7fc2bc6d0b7dc149356144591941bf02b300017622412f6bb9948bbcd
MD5 d1352ade6d620fcb63cddef4c7c2e8de
BLAKE2b-256 6a62b90ed6fdab51df1e581eee459fbc1d04eb3e8366aee01b120a6dfdc05e5f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.14-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 974479d6915b83416033c397cde8e7a37dab6bcf0fab4799183ffbff98517966
MD5 bc9ccd9eddf64bd575d530a7fa6e8c5e
BLAKE2b-256 f18abbb3cb6d51428e1a14e90bb0880dc20c1e00c1da958f4603a32c38025428

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.14-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 a029e6b18a937ba99b4f6102849e388c7e8a00f3c0568c1d50c56f6389ac9622
MD5 0da7ec2c4fb6126528c720233157b551
BLAKE2b-256 ff127cf48b6828152f3c06764ac64afdaa6cd5e64ec229a25c97cb728e2f57c3

See more details on using hashes here.

Provenance

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