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

Uploaded CPython 3.13Windows x86-64

gllm_agents_binary-0.2.25-cp313-cp313-manylinux_2_31_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.2.25-cp313-cp313-macosx_13_0_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.13macOS 13.0+ x86-64

gllm_agents_binary-0.2.25-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.13macOS 13.0+ ARM64macOS 15.0+ ARM64

gllm_agents_binary-0.2.25-cp312-cp312-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.12Windows x86-64

gllm_agents_binary-0.2.25-cp312-cp312-manylinux_2_31_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.2.25-cp312-cp312-macosx_13_0_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.12macOS 13.0+ x86-64

gllm_agents_binary-0.2.25-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.12macOS 13.0+ ARM64macOS 15.0+ ARM64

gllm_agents_binary-0.2.25-cp311-cp311-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.11Windows x86-64

gllm_agents_binary-0.2.25-cp311-cp311-manylinux_2_31_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.2.25-cp311-cp311-macosx_13_0_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.11macOS 13.0+ x86-64

gllm_agents_binary-0.2.25-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.11macOS 13.0+ ARM64macOS 15.0+ ARM64

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.25-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 73cf4fc7d50faefa62f0d4ce631bac95e6450f3c4bd8a62a00f84514513f6145
MD5 fb178991c613f351f783d5916f8398f7
BLAKE2b-256 e04217cc69b9002dfadf8a3dcd05647cc9a3f4c3d89614d5dd7b2c2fd3e19a09

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.25-cp313-cp313-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 216f46b5c009e112c46f74a0808556046d18a3e7fdab8415aa1541af5b44aede
MD5 29809eeeb4d3c6fbe0633df11d1863b9
BLAKE2b-256 217d3e8484fa59a9361d54e426c366048bc571ba9f06de708066b8234ecf65f6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.25-cp313-cp313-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 a6642f1484f3737026ec53b13f2f69fd0cdfe8ffb6aa37b429ba3441ace89fae
MD5 2952e6e2f676ea872a1d79e836b04754
BLAKE2b-256 df9357f56f468a16dfcb40729bdfa5dbfdc5e4c9723206c2d469dfee3487130c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.25-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 7f476379950fbc64be07317d36d8ca2f6270689f51d77fc8e32ae65c57535d33
MD5 882fdec23cec95c010b5504be49fb17e
BLAKE2b-256 dc4fa8217ba0857fc464fbed64567e6db0ca0c4e200de523407c1f56160d43e2

See more details on using hashes here.

Provenance

The following attestation bundles were made for gllm_agents_binary-0.2.25-cp313-cp313-macosx_13_0_arm64.macosx_15_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.25-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.25-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 303cb8463584644546a7586add5c44160809f6caf45b58de4f01ec23bea179fd
MD5 d70e68a9b359ab201ea974e39f2b4162
BLAKE2b-256 551e05ac518d4229b25d0b2dd7df0e3d5931796323836600b1928308e14e763e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.25-cp312-cp312-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 ec82cf30ce0c2f9b3d85da3927e79aa4e53356564eead3dee7360b022d64b590
MD5 4d8540de37520754179a360fe92750e4
BLAKE2b-256 d179ca471a246c902be309a5df3504b4102c220127d3e8da391336c3370f01a6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.25-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 78a02151af29fb1d7800ce40e154c52d0351397e81cb6afab180dee37c5aa553
MD5 6fcca4fe9311afc2dad28342ebd38276
BLAKE2b-256 06c7c874c6cb7a268d0cb36aa972652e666be73dd17bddc8b351c9ba6fc9a43f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.25-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 0cfe9604bf329a436f0ae50dbd6169e9d2deb87df75052cbad990aeef200be99
MD5 fe2e9634f5f5deb1d732cb2a81204ee5
BLAKE2b-256 51c19e19d68d957cc36858a89a8213c85a28a2c8206e793652d7e10672e14f93

See more details on using hashes here.

Provenance

The following attestation bundles were made for gllm_agents_binary-0.2.25-cp312-cp312-macosx_13_0_arm64.macosx_15_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.25-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.25-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 df3634b7775cb4e9dfb3a20a104e148ed611ee6a0323ed5c0ae4910fd9038c0c
MD5 92efe0bb7413ca5347c428b149927161
BLAKE2b-256 5579b573a9383e141cca393e69967e346b25ea648a9dce066fab031f479e9ff5

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.25-cp311-cp311-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 42508f48490e2dcb8c8872d0250af3e32fbc85ea44048ed153b8d8916005d115
MD5 10bb34db8d7ca850770b80e29998b6f8
BLAKE2b-256 daa739b441b543b0e5bad88f6ac99cf7c6bd833125af1ad30136da83342d39fb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.25-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 655556417f9be5af506d050626ce02370aa67cb27cf9eaaaf079364b1220d766
MD5 098c7271ef2584a531c1af60c69ee0aa
BLAKE2b-256 3671706948f404c37dbf94d610065e7c7987d8a23d5fc73e78cacae1690e35c5

See more details on using hashes here.

Provenance

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

File details

Details for the file gllm_agents_binary-0.2.25-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.25-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 c481b1f2a5cf550c1078fefe4973f6346dcb0144255715f50bb7da2a170a600c
MD5 3a445c9ec334e3c9db3eef09fbd34a1c
BLAKE2b-256 e59d6e3dd9ed1eaaae764fdc17e7b635f3ec4d7aee006eaca27645bddddbfd7e

See more details on using hashes here.

Provenance

The following attestation bundles were made for gllm_agents_binary-0.2.25-cp311-cp311-macosx_13_0_arm64.macosx_15_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.

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