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

Uploaded CPython 3.13Windows x86-64

gllm_agents_binary-0.4.5-cp313-cp313-manylinux_2_31_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.4.5-cp313-cp313-macosx_13_0_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.13macOS 13.0+ x86-64

gllm_agents_binary-0.4.5-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl (2.1 MB view details)

Uploaded CPython 3.13macOS 13.0+ ARM64macOS 15.0+ ARM64

gllm_agents_binary-0.4.5-cp312-cp312-win_amd64.whl (1.9 MB view details)

Uploaded CPython 3.12Windows x86-64

gllm_agents_binary-0.4.5-cp312-cp312-manylinux_2_31_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.4.5-cp312-cp312-macosx_13_0_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.12macOS 13.0+ x86-64

gllm_agents_binary-0.4.5-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl (2.1 MB view details)

Uploaded CPython 3.12macOS 13.0+ ARM64macOS 15.0+ ARM64

gllm_agents_binary-0.4.5-cp311-cp311-win_amd64.whl (1.9 MB view details)

Uploaded CPython 3.11Windows x86-64

gllm_agents_binary-0.4.5-cp311-cp311-manylinux_2_31_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.4.5-cp311-cp311-macosx_13_0_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.11macOS 13.0+ x86-64

gllm_agents_binary-0.4.5-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl (2.0 MB view details)

Uploaded CPython 3.11macOS 13.0+ ARM64macOS 15.0+ ARM64

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.5-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 d83313316633c0aef139dead19ca3d008f392502b4aef1b7bdf1fe870a1f508e
MD5 8caf8fbabe121f50d0717e0cc15a71d0
BLAKE2b-256 7e2ccd4b4bb3a0ff805aa2e54c5e3389be3c2da3eb525107f66514fde26515de

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.5-cp313-cp313-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 70ecaaea451fe02e21e765315b7f41665136900f69c23e0395c597906eca8448
MD5 9e251daaf5cb545b97de41413abd19af
BLAKE2b-256 0418ed517b8119a487eba3c4a60d4512614af545db6d6a8c932a438244d95891

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.5-cp313-cp313-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 6a255b8abd1837a425c6da313a2183beb4242f844f36cb61d7fb7202d3ae8df5
MD5 f2fef81ea4d389251ce2b929b8968de7
BLAKE2b-256 c7d5ba6a24c8eeecfb2a86f2b042202b54e0098b57cd871e98b1ae72703d8b17

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.5-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 57913df9f07bbb4cc301c8dc48134dd735f7c6700e56fc52c6ce002e328a12fc
MD5 abdaabccdba51e4ba2e0d5ddd2df9991
BLAKE2b-256 2132f3dc7481002aefb56de451bf43fa5e2b2cb64adf6860928a9332c3002753

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.5-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 997c307ee5a31eabf9c272d3d0fad1eb60fca45a632ddf1044e08922c89040cb
MD5 1e7f3870d9dd4780dcd1c90bbd5237eb
BLAKE2b-256 3c18f2d1da2cc90aea56f80d143ace20ca3330f05eb4bbcf37305ef9812e3a97

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.5-cp312-cp312-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 79642b7f2ce9ef58d504a62cd433fd8993abcca78906e46dd7da0ccece6c2ebf
MD5 b2b9123ec915be6431ef69f79d1d01bc
BLAKE2b-256 6450c9b11ee296b7d8f7ab55c699824926e32f974bce33343f4d4b2b827f37a0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.5-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 dbb87c26be655efcedf2d902b66387c039db138004e20cebe467e92a0c6a0d67
MD5 2768c9f904b6a6a0062853c1f06dec46
BLAKE2b-256 b2d35a9f8f1b2f64159e08757d21664b4fe17eab0ff7f782bcb33300d8758d55

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.5-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 4afe9f5f9e7bb3ec1178f4c0873c32630e39fd3d83276da1788ed7b33ad49ac6
MD5 bebab0ea90c64f499297e0e759cc6b85
BLAKE2b-256 62085e58b4d492aabcc607a07f3750d5bdc13dd031d61b8bc62c499257595128

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.5-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 d020c8885d46b0847402b3518f1a28b3b93d1660721a70af547b650a8f867581
MD5 261c7f120bfc926b756a1814bed1abdf
BLAKE2b-256 7fe636402d66a6ca75b9243923d3c358d6d7537983ca0279f1a84045a3a5531d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.5-cp311-cp311-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 af430f3b626afa7122a933bb3ad34472011c4ee1dd9e7cddc7ab15a40db96350
MD5 f0385485a2c06d2c4c6989ea1de483f0
BLAKE2b-256 d2cdae4772921ca999810eddfd8622a2130ef1a936f0a10749f1c8fb08c9e3ae

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.5-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 781e5c51701bf591b47cef6ad59658d5601d4134e3dab6394878bced681b340c
MD5 62204a5e1b1b24a602b7f2e70730b4ef
BLAKE2b-256 245cdfae1e5a808f2f63d8dc747b1d14a4dbe04b1feb3a2a5dd4bd8c61a3775a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.5-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 245b36a78e97e8d0d6e2503594fd5cc3683a29820f15422168b6dbac66c93763
MD5 02763b1e9dce62fbca1f0cc062547844
BLAKE2b-256 ed8ed3f237802d0dcfe226624dc117c44dcb0004821a5877e08870e0e651a037

See more details on using hashes here.

Provenance

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