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

Uploaded CPython 3.13Windows x86-64

gllm_agents_binary-0.2.33-cp313-cp313-manylinux_2_31_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.2.33-cp313-cp313-macosx_13_0_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.13macOS 13.0+ x86-64

gllm_agents_binary-0.2.33-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.13macOS 13.0+ ARM64macOS 15.0+ ARM64

gllm_agents_binary-0.2.33-cp312-cp312-win_amd64.whl (1.3 MB view details)

Uploaded CPython 3.12Windows x86-64

gllm_agents_binary-0.2.33-cp312-cp312-manylinux_2_31_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.2.33-cp312-cp312-macosx_13_0_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.12macOS 13.0+ x86-64

gllm_agents_binary-0.2.33-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.12macOS 13.0+ ARM64macOS 15.0+ ARM64

gllm_agents_binary-0.2.33-cp311-cp311-win_amd64.whl (1.4 MB view details)

Uploaded CPython 3.11Windows x86-64

gllm_agents_binary-0.2.33-cp311-cp311-manylinux_2_31_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.2.33-cp311-cp311-macosx_13_0_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.11macOS 13.0+ x86-64

gllm_agents_binary-0.2.33-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.11macOS 13.0+ ARM64macOS 15.0+ ARM64

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.33-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 78ef73adaf65368d074508828a2eb72128303973ee9433c8ac9c1e1035f2ae80
MD5 676451315249ac7a14fb5998ac7d0826
BLAKE2b-256 505a0d5b88bcfd5ecf0444e3e4ff35fbe95f86d996f244b112a1bd74b728896c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.33-cp313-cp313-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 ccd14ba3e6e364da401d6e18ac08cb9d477513bf1dd44d8ff3ce54bdfee9f381
MD5 bbfd739e21285bc49800b9930e57e69e
BLAKE2b-256 b7b7ceec24515fac77f7992b86c174b45148c9c91175d5add2653ecfe3313c75

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.33-cp313-cp313-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 3bb642b149e8743e4f4c26267f9e73710509198661859ab47e4c523eda03596c
MD5 4c45dfc715758b9f3b66299269334ae8
BLAKE2b-256 23a320eee8ba72b3dcf04daa0f888adf3a4cf6d395a64844ec450c8baa460bb1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.33-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 a22ab377ae7f16cf80b00e7f168073d1d50de0158482bcdeccd8691e90c8964f
MD5 13eca99a5ba593bcb90f9a34313c2bbe
BLAKE2b-256 cb4323b494e87657d199121eeac30cbd889910833c3a406bf387556d7a2ad6c5

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.33-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 9c5b26338986f951f449e368c2cb335e00efa1c471c10fa096460df66dab5b5d
MD5 80a37384f27904d0978921ee77ae76e6
BLAKE2b-256 10650c83d725ceaa5576d9661e7305563b8b7c3a0cb3b6fe07313fd1a8ec244d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.33-cp312-cp312-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 0cd23167d6adf5dd62e348868a9210590a5918bd13ee55e9686cc154d1261cac
MD5 67e08740ce3d3ad56841bb6a89e5881f
BLAKE2b-256 9c6097be96b74279eab7a5fa6ee33ab66d41b90f61bc2578a2effe8062fbd21b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.33-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 db87222a619fe9312f39995be369a42eb9d989b123fd2f1ba0a27c75d31843f4
MD5 a31cea36954ecccc0ea945374d2729c1
BLAKE2b-256 f80eb9e4b42fd8e96fdc247b0b6658337cf64ef091ae04b15c5d5f598d783a93

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.33-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 df749d4fd2ca275aac2460afb68ae78d3019ecbfdf2d04957e9a870a23412b22
MD5 c37ee4c14a26369d2d61f5e653c8bb6f
BLAKE2b-256 eed4e294a16f6f885364749c5e9532345a1beaad8076d7246e25d3db280d65a7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.33-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 bfcf172dca5c78d71d2d1026fc4eeac630a2fb238ef729fa9c0414a403c6ef5b
MD5 c5d325f3187bb8d176e62f2b0c7ffb45
BLAKE2b-256 3ecc8545cf679d2b66c2e0a17ab6ed55b6b02818e6ba70a0d7d1f025a4610258

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.33-cp311-cp311-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 b4562fecbfe91c5f9182fd580148730c5555b3bf5f1dd6ca427e45893a8ccd2d
MD5 4b03cf70956050d813a490f663f06a88
BLAKE2b-256 9021542b9961707deb773edec1329634ee6475766474e57b684535efc3443ddc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.33-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 a2e84ebae7ab4408ee95ee5acf40ce77199e20a25b611adda9d592f6dd76765f
MD5 faffb8395a36e0086d672c61f651a65b
BLAKE2b-256 b7b1c803b3bd16b6a5f65d86c490083529858a695498c1fa9c0dcc7ae62fd416

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.33-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 e4ee3442be262a2aca43429bf37236c26469bc482f04c6061a291520537c1963
MD5 a29a801e343e62d6f1805d9e31e7e0e4
BLAKE2b-256 540f60f262ff35f6538fa4dcb1061778e8d629d8180a1d4251887a203bd4fe1c

See more details on using hashes here.

Provenance

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