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

Uploaded CPython 3.13Windows x86-64

gllm_agents_binary-0.4.13-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.13-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.13-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.13-cp312-cp312-win_amd64.whl (2.0 MB view details)

Uploaded CPython 3.12Windows x86-64

gllm_agents_binary-0.4.13-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.13-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.13-cp311-cp311-win_amd64.whl (2.1 MB view details)

Uploaded CPython 3.11Windows x86-64

gllm_agents_binary-0.4.13-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.13-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.13-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.13-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.13-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 028bf518472d47e123a01485198877e70278a1f05134d006b5e5a6013a26c5d1
MD5 8fe2aede313cf54ed3260943284aeec6
BLAKE2b-256 8f881eedfa41c23c3ee8306a7dbb77c00b17e38012968fe3f80649a72bbb28ef

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.13-cp313-cp313-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 d247a5c25b1fb63c0a79c0a35058fc95b0ff2bb8cf107db43c11270173cd74d7
MD5 dd33d9393044cba71ac72a48cd7c38f5
BLAKE2b-256 d922f9bca74b5d58ef3edae162616347e4052e482d5589e48ac88261048b080f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.13-cp313-cp313-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 021e395978f0d119768bd84fa4c35c660e82a96dcb0832dbeebd493bd82ec877
MD5 b25d899ec7671da3c9e4ac707d1fcc3e
BLAKE2b-256 2c3fdfde45f3ff8eee0ef5a0f6d4c861ca22ccb2cd25fc1391006fea6425c58c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.13-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 3bf3f73fc1aae8677c254b8be6d3843a7a07fe2c0d15adfc984866e0b56be032
MD5 7ab3c15f796f8ec4370f8531bdaa6b58
BLAKE2b-256 84f7bda7d49876dff2c3198f79667d17563bec5f1c35b10ab40d2463e7effb2e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.13-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 3a1083d0f0f80372acfbc2d888a7b4336505d2749bb7353a4cf8af98bdf0e8c5
MD5 18dab1a04126d56849c2c857ec77bba0
BLAKE2b-256 e5a3e326d488236292ff70389e4a0d040ddcc406798f0d1f3ed965ade726c170

See more details on using hashes here.

Provenance

The following attestation bundles were made for gllm_agents_binary-0.4.13-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.13-cp312-cp312-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.13-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 5d598e6c004a5c8e397b1cbc4b47d7239bd281554b816716e33231d483bf2590
MD5 87eb5e2605168bd16f76e9b83d7a56da
BLAKE2b-256 a4c61d9d5999cfd1b056c417ea71c44ca765df8f35218bb62f3e34a86e4cf86a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.13-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 a69f4bdd5a84fb450065a7ff940690ee4bab99021216c201589e1baba385cf26
MD5 51bd40e9d7930869c5d1a3a62484670f
BLAKE2b-256 2cb18ba597a77441f8ad70337728413e494c31efcc100ddc54ad8d7509326bbb

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.13-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 e082dff3545cf57c647b95754d82463fe88a43a8680622f007a9ca308cdb0d0f
MD5 b62775fdd8e565e6fc0f2f846580a3b7
BLAKE2b-256 4711ed20dc0149531f6c4a411e314aab51bf79973bcaa889a51b1a9f2a2679a7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.13-cp311-cp311-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 604551119e2896c49deddaeec6c9a748214e39a9901e15745ac2a990d7ae4eaf
MD5 96f0bd18afd88e51344adfc78fd8179f
BLAKE2b-256 8f10d2e71b1766132750165395ad3c7cf8834325f2150a17a05d1436b81df430

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.13-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 1d44dbfccea94c3550b3f4eb1dfafd9d1fb3236c16194f835fea214bc169dda4
MD5 6709ca5c5839ee3479868f10833d5360
BLAKE2b-256 c514f37bfd9ff8b2f92e09c2d675b366ff7234a7228ae8e8889429a3e0b0398e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.13-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 21de0684569bc6859806536a65947f190350190675863e5fccc4080091cd1975
MD5 1b8e52874d0cb3531e0448b87c63460a
BLAKE2b-256 b98caef9a503496557292e4061c079d92129200b9991727a4d2d48ba9f973a2c

See more details on using hashes here.

Provenance

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