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.26-cp313-cp313-manylinux_2_31_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.2.26-cp313-cp313-macosx_13_0_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.13macOS 13.0+ x86-64

gllm_agents_binary-0.2.26-cp312-cp312-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.12Windows x86-64

gllm_agents_binary-0.2.26-cp312-cp312-manylinux_2_31_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.2.26-cp312-cp312-macosx_13_0_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.12macOS 13.0+ x86-64

gllm_agents_binary-0.2.26-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.12macOS 13.0+ ARM64macOS 15.0+ ARM64

gllm_agents_binary-0.2.26-cp311-cp311-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.11Windows x86-64

gllm_agents_binary-0.2.26-cp311-cp311-manylinux_2_31_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.2.26-cp311-cp311-macosx_13_0_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.11macOS 13.0+ x86-64

gllm_agents_binary-0.2.26-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.11macOS 13.0+ ARM64macOS 15.0+ ARM64

File details

Details for the file gllm_agents_binary-0.2.26-cp313-cp313-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.26-cp313-cp313-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 76ffc349051a495b2b7f1e3248c76c7a0f396d76e79a4b3a74121fcca4d465fe
MD5 5d4df40b1f0e610ebf4025485eac91ed
BLAKE2b-256 b195ca1eab40cc7d239d9ad97dcc827a6e51be495c3f579e7b44ab958c9dabe3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.26-cp313-cp313-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 51ffcc5d964b529c24fed05c7ea64dcbc465b1efa0533e2cae7a13f8ce62b840
MD5 10fea5fd068d2367701608d18b3e70b4
BLAKE2b-256 8dac47eda60ad930d623dc1d239cfa15dd36956dac6e4a48866dd084b4eb9090

See more details on using hashes here.

Provenance

The following attestation bundles were made for gllm_agents_binary-0.2.26-cp313-cp313-macosx_13_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.26-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.26-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 67ca41ed87b3a35c0ad4f891a4256480e73ea09d1b5b006ed53c879ca7853dff
MD5 2f90b8a7ce86ea23a3dc2d7d46b91a3c
BLAKE2b-256 ea2fa42501eeefd667e82ccb0a1b4e4e452505b0b4cd35c9527a807368dec787

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.26-cp312-cp312-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 816f73892acd6399d45c50271dac4c6be5bcfb1b729335d2d3c4d85887d835ec
MD5 6688e3f716b13d098691f1c6dec1fb9c
BLAKE2b-256 7d88617807195e8c981057ad9ae9dd446c47b4e20aa2ee05afe7a0cac923492f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.26-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 83978286bccdbf015829a58c3130152f8f5ce0ad5ae3914096f9f7f90174bc05
MD5 6886ef3c5f4d3c6b5492539d7abc8b0a
BLAKE2b-256 8e4e2db3c2c2072f26f7f61d371cfb917df6b5aaca0c42e3b70774e765ee2e85

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.26-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 dd9593c4b63e6344f3966a71a91ec1b85df567396080b75013d91ecf4eb34560
MD5 869042000d483d579528e94e0e42b347
BLAKE2b-256 3705de76936b835b17dbc9b4653448cda241ee070906779540d5eca9dd68c057

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.26-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 01c56e7ae6956d02d9720d1606cafff1188851f163855f2bce696dcfc8ac07b5
MD5 444823359c87a3867f8dc7b6c7d27f2b
BLAKE2b-256 1e13cb9b4c31b8f7c2a70bd12e8c6c283628d503933730d1c92919937793ebd6

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.26-cp311-cp311-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 634a5938758858da4f19e46bea0f84139ade324282ecfc646d30b93df98036fb
MD5 997d7bd3a8e164eeef213264c6ca0113
BLAKE2b-256 09ad86d89bd6a851ccc8c24d0f6cefbece2d031e033c2782945467bacef64331

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.26-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 649c9987019c276ce9c5e74e3a4bf102b676e5005e1a6d42623cf5cdee439f56
MD5 5e787e8213a47d53db71a48ccd300679
BLAKE2b-256 8d0e450691b62e3e8e2c496583564693472a76368cd64c1ef770da14e61d1854

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.26-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 d6bdf7f624afec36245a64a95b634657eb57c6afecd2e100094749e9f5bb2fff
MD5 b3e22d6b63f79989e9d7df2b1837e4db
BLAKE2b-256 87cc85d6d471098bbb73fe0339762694bab7cdc26799539292790ddd977de603

See more details on using hashes here.

Provenance

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