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

Uploaded CPython 3.13Windows x86-64

gllm_agents_binary-0.2.18-cp313-cp313-manylinux_2_31_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.2.18-cp313-cp313-macosx_13_0_x86_64.macosx_15_0_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.13macOS 13.0+ x86-64macOS 15.0+ x86-64

gllm_agents_binary-0.2.18-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl (1.0 MB view details)

Uploaded CPython 3.13macOS 13.0+ ARM64macOS 15.0+ ARM64

gllm_agents_binary-0.2.18-cp312-cp312-win_amd64.whl (972.0 kB view details)

Uploaded CPython 3.12Windows x86-64

gllm_agents_binary-0.2.18-cp312-cp312-manylinux_2_31_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.2.18-cp312-cp312-macosx_13_0_x86_64.macosx_15_0_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.12macOS 13.0+ x86-64macOS 15.0+ x86-64

gllm_agents_binary-0.2.18-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl (1.0 MB view details)

Uploaded CPython 3.12macOS 13.0+ ARM64macOS 15.0+ ARM64

gllm_agents_binary-0.2.18-cp311-cp311-win_amd64.whl (1.0 MB view details)

Uploaded CPython 3.11Windows x86-64

gllm_agents_binary-0.2.18-cp311-cp311-manylinux_2_31_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.2.18-cp311-cp311-macosx_13_0_x86_64.macosx_15_0_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.11macOS 13.0+ x86-64macOS 15.0+ x86-64

gllm_agents_binary-0.2.18-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl (1.0 MB view details)

Uploaded CPython 3.11macOS 13.0+ ARM64macOS 15.0+ ARM64

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.18-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 70c3c222bb959bcf0070190cb4de6f04a08aa26fb226bf747b60384c71f22867
MD5 e307e269b31a18efe51837052fbd9a63
BLAKE2b-256 b5908d12fe9d7cb8dce676a0cc7ad34d44fa2b3751383d1872ea0cdcb0e2b5c4

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.18-cp313-cp313-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 f7dc1045f8a0fbf2fd8b1095bb8edc1f065352864e61ad490490eb81c849a820
MD5 94d740d5d1236f131f611a48c66c3ba0
BLAKE2b-256 eaa0a4b7a5636a8a7d455f19ce4e097c8c132878beb9e286060fd57240abcc4e

See more details on using hashes here.

File details

Details for the file gllm_agents_binary-0.2.18-cp313-cp313-macosx_13_0_x86_64.macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.18-cp313-cp313-macosx_13_0_x86_64.macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 5c697fea2f21c74bd64022a8c6d56bd197bd9e35e1518df9ced2c7a9b75a89ef
MD5 b54fa9bea2c5fc323406f69eb9891cb4
BLAKE2b-256 44c26602e5054935cea4ef649f171693dff43a0cb5b01ba756b4a93ca21ce116

See more details on using hashes here.

Provenance

The following attestation bundles were made for gllm_agents_binary-0.2.18-cp313-cp313-macosx_13_0_x86_64.macosx_15_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.18-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.18-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 8a12c57cdaa645442316c60e8d924d12378c2544db56966b72e9b6b7828b299c
MD5 81b59c9820bbab8a6aab59e439c0e552
BLAKE2b-256 65d4afb8e522bee5939b4418ae59a180194d04739a60b8edb528f7fd239f3698

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.18-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 6a4e73d06c742da2cf433b319bcebfe8d35261d592daf4f1de09b9a7d5dd1f50
MD5 c72f8620b7dfa0e8bf96238bf2fe4c30
BLAKE2b-256 581c531a98a910499130e6e5977a7b3d81e220cccc806f31ea5bbec5a6ebffae

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.18-cp312-cp312-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 838e55215893dcf8db9b17bc1be9964cdf19b11bfc4aacd09bcdc82b2748f6e8
MD5 e9c9d4d5b307b40ea049a9e97b0e638a
BLAKE2b-256 103a62643deae21c77717def8dd9c83aec378dd50032fd9838d65786bd0e71d0

See more details on using hashes here.

File details

Details for the file gllm_agents_binary-0.2.18-cp312-cp312-macosx_13_0_x86_64.macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.18-cp312-cp312-macosx_13_0_x86_64.macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 d829bfb549891e00ccf61828648dce484c16bbc69c2b5c4914cbe8c17a5824b0
MD5 1d9f603c7652b503a3749176aa1b4b75
BLAKE2b-256 cd7d87307dce2f01ddaab5fcafc7cf60e336576f3482c75d7e668cad36e17e8b

See more details on using hashes here.

Provenance

The following attestation bundles were made for gllm_agents_binary-0.2.18-cp312-cp312-macosx_13_0_x86_64.macosx_15_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.18-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.18-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 63ce54f5d5d7f0187dfb3af5aabce275513d720b2d2506b58119f794e3a74644
MD5 1e02a5c7998319fafcbd72d2cb146196
BLAKE2b-256 0f22c5782ded23fc2bc655d4c577c692332dc8443529169a9efb3305aa69c266

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.18-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 427523d36bfc5154f67c2cc253615283232d804acc811cecf54c190be8a378ce
MD5 dd518d654fd843d5b4c79fe89ac13f4b
BLAKE2b-256 b9b7826e0f00068379b562540ee01c2256ab6dcdefe22857bbceef95e27dc952

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.18-cp311-cp311-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 23112a8b4f1c6566695d2bea2918c4bf242a7d2cff2c327dbb547a74bdc4e42d
MD5 7f141cdebcb92d5d7997bae65a8e73d6
BLAKE2b-256 1e34f6cd2177776bab335f25c298fcbcb603b41c71bbe84f8f0182e1bff77822

See more details on using hashes here.

File details

Details for the file gllm_agents_binary-0.2.18-cp311-cp311-macosx_13_0_x86_64.macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.18-cp311-cp311-macosx_13_0_x86_64.macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 0942dbfac2ee1b08376896f88c3f12aa803393192eb63cfbd43bf1e991227636
MD5 8b7198b6225be24457cdfe8aff974181
BLAKE2b-256 8e27d00b21beab04811837a6fcfddb76f1c9c4273ec7a143544448d908fbef76

See more details on using hashes here.

Provenance

The following attestation bundles were made for gllm_agents_binary-0.2.18-cp311-cp311-macosx_13_0_x86_64.macosx_15_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.18-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.18-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 d876fac173f021189504716c24c1aed8441acf9fc7df4d5cb26e5b02f5776a54
MD5 f0ea8197b7159d788310207d894753ff
BLAKE2b-256 9e8363ec30b63bf5390addd6bbf410dbe830adac96a8f80ba23209b2da1ca03c

See more details on using hashes here.

Provenance

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