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

Uploaded CPython 3.13Windows x86-64

gllm_agents_binary-0.3.8-cp313-cp313-manylinux_2_31_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.3.8-cp313-cp313-macosx_13_0_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.13macOS 13.0+ x86-64

gllm_agents_binary-0.3.8-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl (1.6 MB view details)

Uploaded CPython 3.13macOS 13.0+ ARM64macOS 15.0+ ARM64

gllm_agents_binary-0.3.8-cp312-cp312-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.12Windows x86-64

gllm_agents_binary-0.3.8-cp312-cp312-manylinux_2_31_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.3.8-cp312-cp312-macosx_13_0_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.12macOS 13.0+ x86-64

gllm_agents_binary-0.3.8-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl (1.6 MB view details)

Uploaded CPython 3.12macOS 13.0+ ARM64macOS 15.0+ ARM64

gllm_agents_binary-0.3.8-cp311-cp311-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.11Windows x86-64

gllm_agents_binary-0.3.8-cp311-cp311-manylinux_2_31_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.3.8-cp311-cp311-macosx_13_0_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.11macOS 13.0+ x86-64

gllm_agents_binary-0.3.8-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl (1.6 MB view details)

Uploaded CPython 3.11macOS 13.0+ ARM64macOS 15.0+ ARM64

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.3.8-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 65ecbac4e29ea3a5eb835381bd1bc0cbaa13dbdf9b71d5c661a5c568bd1651f4
MD5 c129901770962c416a0e6a64dcc2df87
BLAKE2b-256 4f6797ef1986631a9313a2ccd5aa7fdf75f9f47e8f0195710c785ba8b56b268b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.3.8-cp313-cp313-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 a437ec9da84c94e4c0c08492a16a112c9f02569a4987cc91c7ec63c06b0110ec
MD5 70abff449df81e4599556e6a62175f8a
BLAKE2b-256 38bef103d280a12216951f56f6fdc232f3c756e5de52a3685f873688eb95e762

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.3.8-cp313-cp313-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 5f258b458cd99c37047e61a2aad82b244adea854cd281a11197455ffd8312dd0
MD5 0052d9ebd3c54986e65a673d01a92b86
BLAKE2b-256 9d30e5aac51ab244e9c98e6873d56807d4a26bac2f82ec14b69a4e4fd09146ff

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.3.8-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 490f9b1e76c287de67a253c8347913be95c847cc339837ff1f9c1b23524acb1c
MD5 3e44b44dca9059b38de4e0e3cd13ce4b
BLAKE2b-256 b71c0e9eb17fef752fe1c1d07f19bd1f91f2e7d42522596391caac9d0527cb85

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.3.8-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 5785d2cd27a4fc5a7eed771f89fa6b8c03ed595c9a47d1f3a7be6a7517cbda9a
MD5 9ceccde425183b327fd75c43d572af01
BLAKE2b-256 d7ad9d8b5945f609073e88935cc09ec1bce58261c780c1c1854bf99088467733

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.3.8-cp312-cp312-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 5546288d960d2cdc0632ab0139f5e2ce00877f752fd6c79200b2a33b59ca7b13
MD5 9b92244165913dad789021df09127a48
BLAKE2b-256 733d4f3771730494373a93852f1c7ee3aa4be29cbf94d4cae4f8441d280b2067

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.3.8-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 95034cb20e50b6fb502008fb2dcbe8d32c157ab777707e919e4fdeebd768459d
MD5 b62e719fa187370626e121305085f82e
BLAKE2b-256 09cc5b31e51aef9968c6d6518f50548899c1aac24d939b283ecac8c8df136cf3

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.3.8-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 dd22acbbd74ba2a86c414208e2147463847f0eabecaf999a4e46969a818a7392
MD5 a7b769854a398b68b13f63a1d3dabe28
BLAKE2b-256 47b6fe17354d68cbee8b9a7c612f98f6e33e2be120fc668c281967de1530eeab

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.3.8-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 bb9dc998413c9d349ec699b7ccab3a3c8ed5a3df893de4cb2f20f34ee3c6eaea
MD5 6730ef8b2184b76c008d3c60a4433fb1
BLAKE2b-256 be07b4f32a3862484901e8d45da0d18cf2e205f5cd517d7b97e3976cc7f124fa

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.3.8-cp311-cp311-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 0f124880302a8df369982cab50e2c38cd5a81c9aeaa6f85404bf9551c9d6885f
MD5 8c99f3c971fa058d4d7cd66ba77b42da
BLAKE2b-256 dccf774e96cdaf142887236927e6122976e803b1fbc1db2c57c4e8fe109c7af3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.3.8-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 b361f5ba801ee5ea082cae49b745a7ef6f1a7960cb8c8633ab71d66cf98af3ac
MD5 59d2e45b432849fbcda134bc6ac98637
BLAKE2b-256 0ba61fa688f98c8380f2f84c86d6029a10c7355fa7bf0fccfec931ce1cf55c78

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.3.8-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 038f8fcb6669c68f7c6444622e12d76da25cb578df66114fb9423948aae412cb
MD5 dae432097a5e7be24f01b7808bb9567e
BLAKE2b-256 35104e855847572b142a8a94ee42bb11789ba9f8b8160bbbfc3ddcd1d350adea

See more details on using hashes here.

Provenance

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