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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.11Windows x86-64

gllm_agents_binary-0.4.15-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.15-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.15-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.15-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.15-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 5f9dde9f582733341321372a7d2734834dfac54642a80b8d435a23c388763cac
MD5 2ce7205889edea5016131d06f33adcef
BLAKE2b-256 066437248c507adb0a3a0450eb6b7b8aeb77be24aca6bd96ce72e8127319997b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.15-cp313-cp313-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 ac6625465c2ec32733ace4ffcf588660c399497945bb2ef1f453ec21703532d9
MD5 62ba2ab21d3bbdfdcfc42601bd2cf8e9
BLAKE2b-256 6aede4788454992b99467be729ed612187f276774352559ad8d590715c56c732

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.15-cp313-cp313-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 9c765a573e90d64fe960b2f91df5c923d189f6c4d0ec1da86edecfc4bb38ca5f
MD5 4b539669f70924b1e3cf1b73d5ee85d9
BLAKE2b-256 db36b63767e11ab5eed372cda583da6e77fdcd6341eed4c1d7fb21d755e29aed

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.15-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 3e0ebbb1fd83253bdea3952e81937966c17df1b301b0aec547dd93a2dceca05d
MD5 371cc8eb94db8750d848e0274af7d473
BLAKE2b-256 f6bc36354dc44002f673a647797ba8b7e8ada2d06d3f51ffe308066f26f33696

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.15-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 b900c35c4ab9ebd46b415f2eb9f63db7e116be70a00129512a56c7431f08746f
MD5 6d3d2e45b30a266359230ba6c6dd3827
BLAKE2b-256 9883d924ee4f46b1fd79759d5a64b1d4d343e2ce4d2a94d8c716e783cc61c367

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.15-cp312-cp312-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 03c4ebd8a5bdec7d5530ab29059bacb2324bc81cd6bc2dd6ca6067a51dbc0fd6
MD5 497dbd5d45688156d185a4025500fc4d
BLAKE2b-256 92236321713ccc52340c7a06c037b6cb9c0cbf646631ca333f3e3879eced711f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.15-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 2901499dc3869ffe5f0bdae327e4631fef663020210ac6a0e962e294452ae9f5
MD5 7ac6a49ce02793358f8607d93d51cce1
BLAKE2b-256 677b3a5412b9bc087e14ce2c141096139e043277d881b4deda364671c676b5be

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.15-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 d12bd0458652b782019561954b8c5471f436f003f5f675401b2043efa5c4bc63
MD5 0208f109f83d1aeda7c6be82bbd7c6eb
BLAKE2b-256 300cc777ec8721eb6918eb9a28a13f9c15712d7cf6688fb0375c7e06dc98c4ab

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.15-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 0365a46b753aa1d35e3fb5fd6f5e11105c7063fc0717fc3bf6b7330c918ecaeb
MD5 6c009c97024ec682adc4eeed4f0a4144
BLAKE2b-256 79dfe59d4ffb59d8f9d3c86f936a78d81aa3346f2ebe4c6995a97a57cb40f11c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.15-cp311-cp311-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 3af053c8db5fcb1c09493fe4b2665891ff5076639d0f95e4d6cf683955ea67d7
MD5 ad485c4a55298856245536c5b3ddd6af
BLAKE2b-256 a29657096cb695a8830ef4e46ef2874fe5d304c40b385219a3b7055280cfba83

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.15-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 35887a65d80bb474bb356973e5cc36bbc56c39c474c7bea88379e03590b513f7
MD5 2e51806d1390993145309b648399ad3f
BLAKE2b-256 52af48867e7290e36bc29516e63e443bb3c2dbb66d6b3401a4751af30a15b91b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.15-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 8ff7597a3924441bfff928e511b1e3be5229a7ada10d89a30db85d0b8563dde2
MD5 08bcf4d273dc56cab3264b08dcc6a74f
BLAKE2b-256 c6b5573a917dcdc70eab089381ef19b451b6e3d9b8fc45dbad3ed1227a7a2288

See more details on using hashes here.

Provenance

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