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

Uploaded CPython 3.13Windows x86-64

gllm_agents_binary-0.4.12-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.12-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.12-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl (2.2 MB view details)

Uploaded CPython 3.13macOS 13.0+ ARM64macOS 15.0+ ARM64

gllm_agents_binary-0.4.12-cp312-cp312-win_amd64.whl (2.0 MB view details)

Uploaded CPython 3.12Windows x86-64

gllm_agents_binary-0.4.12-cp312-cp312-manylinux_2_31_x86_64.whl (2.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.31+ x86-64

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

Uploaded CPython 3.11Windows x86-64

gllm_agents_binary-0.4.12-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.12-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.12-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.12-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.12-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 0a0419588d11ab4faa63fb071e9767d6346a82602d6c9c5ae6f44ccbf42ea2ab
MD5 3b9ec1915799fe04a6dc9fe87597efc7
BLAKE2b-256 01a38602501f6a3a298ca8ed471c3af0075fe8e6aa7ef3459cbf394ffc328d29

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.12-cp313-cp313-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 bcfac76a145ea8bd66ba1bfcd331bbb6d25811c466449bf62ae33ed2a4160692
MD5 c17813e80d6417c103b882f0b81b7cbe
BLAKE2b-256 ef119738a8b932924a0b9f710fd21f1146e7a061efb034e49c4e921c0b9f10eb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.12-cp313-cp313-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 d34ed0a35fb5dd738af4cb9f56d73a764f5689c6509869eda61118eb7bc3f1c7
MD5 212a20e8546faa83a88db3bbe40f750c
BLAKE2b-256 7750b202633f01c91d093a1e28d7650ad523d30fd419837468a36a121c633cae

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.12-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 4c759ee502f234feed73d1cd521795e6e9d3ba39b2bbd425e99ea8380a691cfe
MD5 4b9724dcdaec1890b1a553c2f2211545
BLAKE2b-256 c29f457af5577b7e3faf4267d781d19c2a5c05e4d192536d50feb2a4c9d4ce42

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.12-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 14bd7eace07ef39c45001aae8bc0cf07cff4494fe21e2483ddc7a1647c718403
MD5 438525ebe1f852bf5fe4a929fe1206f6
BLAKE2b-256 9e473700a06beefddd6e6a8cdb0d32682808ad7577501d1cdfe20ef8367db9fc

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.12-cp312-cp312-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 a3e6af3821854174102d3bfbe700654128a51f3f2b2dc5f141f41ed0f0da741a
MD5 bccafccbff13a4b2116cd772647ebf2c
BLAKE2b-256 11d138c5d1f3d8afe4798afa91454a80108f7c9dc78a96c159fe1a3d42fc6f08

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.12-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 27a88aafebb59a2106c1e0e77ad90fcf3205c5007cb71f585fae6a3ffcc3765f
MD5 f80d883d7ac0e8b0dc054480d8a63232
BLAKE2b-256 6aeade3266409c6159d85dbd34b40587fac98c8b52188c0365a6e757fc1a545d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.12-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 baee4bb1020cde56f4d6d4fbd391c7d77aa2a3fb411d79e6f7861f93f91b9222
MD5 e4f8cfd6c83fbc6b556d37800bd91934
BLAKE2b-256 fc0a35cd4e1eb54c1f4f56bd393e6a498ecfe68ee641d2cc58aa246cd22b9673

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.12-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 a71330da212becce0ba9d1b44834d772cfecad21283cc04e8b6e07cac1e6c53b
MD5 ae4e54c91d81c531b77a6c25483fccac
BLAKE2b-256 0703e8f7420936af5ebbfae39441acec4fe0f111b76fd43808dd4a690bb4a07e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.12-cp311-cp311-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 39c3d3492046cd4b9116b35744b3638beed2a4267a9d842865eed132fab3b975
MD5 7bf12d3a372fee5eb204bbaad0180317
BLAKE2b-256 d5bfad42ddd95130d0bf74b88c3d29e8790eecbb17c35bdadc4b7aa6ec5b4877

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.12-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 89eb62bbbf6598a37a5e7220fafaaabd4a649a729338ea0888f531f8091f1707
MD5 49f805ca8147e35572864a276b77bde6
BLAKE2b-256 3a65d8031417bebfd0d39092f878b3ebee03979a5aedd1826bee32d17855a540

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.12-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 eb79db392f6a7e2e4222f1070e89e5e650b6c3b0d0f8d7537412aade4ce3602f
MD5 bee993e4f613058beb2c1147e9db0b55
BLAKE2b-256 f62f1f511f2ce81918214d91c9fe9a6df1bbad447f65edbb79bd4ecde8e5c5ad

See more details on using hashes here.

Provenance

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