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

This version

0.4.1

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

Uploaded CPython 3.13Windows x86-64

gllm_agents_binary-0.4.1-cp313-cp313-manylinux_2_31_x86_64.whl (2.6 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.4.1-cp313-cp313-macosx_13_0_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.13macOS 13.0+ x86-64

gllm_agents_binary-0.4.1-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl (2.0 MB view details)

Uploaded CPython 3.13macOS 13.0+ ARM64macOS 15.0+ ARM64

gllm_agents_binary-0.4.1-cp312-cp312-win_amd64.whl (1.8 MB view details)

Uploaded CPython 3.12Windows x86-64

gllm_agents_binary-0.4.1-cp312-cp312-manylinux_2_31_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.4.1-cp312-cp312-macosx_13_0_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.12macOS 13.0+ x86-64

gllm_agents_binary-0.4.1-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl (1.9 MB view details)

Uploaded CPython 3.12macOS 13.0+ ARM64macOS 15.0+ ARM64

gllm_agents_binary-0.4.1-cp311-cp311-win_amd64.whl (1.8 MB view details)

Uploaded CPython 3.11Windows x86-64

gllm_agents_binary-0.4.1-cp311-cp311-manylinux_2_31_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.4.1-cp311-cp311-macosx_13_0_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.11macOS 13.0+ x86-64

gllm_agents_binary-0.4.1-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl (1.9 MB view details)

Uploaded CPython 3.11macOS 13.0+ ARM64macOS 15.0+ ARM64

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 5c423258adc267533181fa2093d009e01c45847addb385a474d8c5b3e136d16c
MD5 755ccb23224b6ec83b6d3a17e5704126
BLAKE2b-256 9a3714257d24376df34be889438a4f5fbbd72aafef528ac2e2924beca077b48a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.1-cp313-cp313-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 0378dc849a2d81b6f08a8b242b97346277fc9dec5ef23d8550e522ca3104c1ab
MD5 86ba247401d8b579b8e6e917a24ed745
BLAKE2b-256 04edb76c2a7ec778bf04b5e5c1b30bdaca475cb53e587e08c35fcc3f656f1893

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.1-cp313-cp313-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 4f3f761b14bba1de74d076334130d08eec90f307c536dc7e9f6d4da55d7ae0f3
MD5 21f961714f1e6a1b730697ef80e4a104
BLAKE2b-256 2a7a41f2e1b4cb6061a2b0870db27968ddd03a1b425ece26c321e0f3fb908aad

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.1-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 548e055e1e10c22dfcb1d76eb563707b7afdb89291235c956cbf180b6951837c
MD5 3158635c998f6251a8cd7ee180cd1a5b
BLAKE2b-256 154eafcf334b2e2fb298c71a4335e86fd47f7a357fd682d5b390a0bb09d8a7a7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 5e32631c72b9c57d1415f82bbab9c2e662d57165bdfdc45c9b8e5d25d2ea1d24
MD5 d33566091b015180b86b20180657623b
BLAKE2b-256 979a53a4263060739b76bded2304e915ff10410c919c2cf825d1896c1dbcfcb5

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.1-cp312-cp312-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 40c37a335e87b269354ccef80769f4c273aff29782a7f68469b910c0fdc96241
MD5 4b6049d0ba4225061304a4d57240a330
BLAKE2b-256 98e464644da5aea18a4d52836d0a2b4ca47b72b08eff24783d94e40ca63d423e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.1-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 b1179b216902a951dc8baa43d056a7ed8cb136b630af266b049e69e745bcd293
MD5 f0c9253fabd70a414e71209ed743a8b5
BLAKE2b-256 adfdb8f9a0c2e9ffc69631c45d8496f2947279fb57068a025abb8ecc919291dc

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.1-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 192575eb0db2db7124913ddaed87f9a8a81ba6d8d6be9bad569eb6a6c61d9a66
MD5 758f639409b0bfc3b1bcfff68c98907c
BLAKE2b-256 9c289e5386631b0f7b8920451181ce3838c8fe76192f23009f8eb435bf5344a1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 bed41d9d661130179ceddbb47ae0eab4864a808c65fa8b12b8ca3343813b54bb
MD5 943238d49cee10f156cbd35fee28d43b
BLAKE2b-256 6f88b797d155449e26153b3b9946162e6df41e0b5240a1908c2d56ca4356027c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.1-cp311-cp311-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 6c61345ad801169194a8120bca460efabf53e79969bc9b08914b0772c1c05fa7
MD5 309cec2abb172a84a017fec38426c14b
BLAKE2b-256 a38e90ba72f219dd12e88d5fce81c9dfb5cf4c956604e184e205220eac568d00

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.1-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 a7b4e4a877e1bd6c7df9e42a15a60188f923fa5595e9247ea08241a8e85371a2
MD5 d142c9872b83cf17b05d002bf2440cc9
BLAKE2b-256 18199931d9d4644c494847a6b473869940fd2d390dec3cad62aa37944b0e3b47

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.1-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 2d699e7d557e95bb9ecb528c703165936eced401889917881525707b2f65eb20
MD5 98d04ff4f0694ad9e3f312649ab1766b
BLAKE2b-256 777f9e96908080cb9cc0faade4e8698cef823ceabb3b4e3c27d150063524b7cd

See more details on using hashes here.

Provenance

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