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

Uploaded CPython 3.13Windows x86-64

gllm_agents_binary-0.2.31-cp313-cp313-manylinux_2_31_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.2.31-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.31-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.31-cp312-cp312-win_amd64.whl (1.3 MB view details)

Uploaded CPython 3.12Windows x86-64

gllm_agents_binary-0.2.31-cp312-cp312-manylinux_2_31_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.2.31-cp312-cp312-macosx_13_0_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.12macOS 13.0+ x86-64

gllm_agents_binary-0.2.31-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.31-cp311-cp311-win_amd64.whl (1.3 MB view details)

Uploaded CPython 3.11Windows x86-64

gllm_agents_binary-0.2.31-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.31-cp311-cp311-macosx_13_0_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.11macOS 13.0+ x86-64

gllm_agents_binary-0.2.31-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.31-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.31-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 f84f419f6801ee72d059b4d08e4d4b6d87e1732ec526f0fef65972cb50157c7e
MD5 018452ecd8119eda91bb9e4b99f26e69
BLAKE2b-256 56187fd3a71f960bb244e31c5df7ca7061966e6e576e9d3e9e704a06723383fb

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.31-cp313-cp313-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 134489a660a38cb6d97cdac3d30851324019979acd24a6fe672f5e8cdf6c3ab8
MD5 175196ecc3177ea2b5a103e9efc5b87e
BLAKE2b-256 022c17fb68422f7e068c273f52a1a822e2411678826e29cac82defd57e07cc3a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.31-cp313-cp313-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 5eeb07aa11eddbe6da3582ab7fba28839356e9efa84c07e5daba8f9c514ec3a8
MD5 422482c69009a2f91f53b12c9ef2a971
BLAKE2b-256 d55e9184451511ce5b398eee948d46d295bd12d53ce600cb2ec623872f9ab0e3

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.31-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 53170ff259c243408439d898c577dbc6aa906f9069c0ec5c724e575bf7cd7596
MD5 b0f867c4523b9091a3c3f0ae4eb32b31
BLAKE2b-256 82171814c5113674b618123db89fb00211756e7dcc3bfc08bf2a32298a65e890

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.31-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 7bf7d58905cf3a77ba3ff28e3303679b64a780254aab6b5af2547d4548852837
MD5 07ec80eb3dd9d4620ece422eb3d1e502
BLAKE2b-256 3eb51cec63147b109cb4b9af7c9786e376d695bf2e5afbb000abc17942910299

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.31-cp312-cp312-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 a7fad63f4c389baf51ecdec2f620453163642a9390618071cd3426e3e987a8f9
MD5 b530ccc2b4a35df7cae5f0c78cff3749
BLAKE2b-256 f26a06bfcf75c84b8845fe60d3d6f41f13cc5bb6084e7df2a159e59293b9c5a8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.31-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 73a2d6f7c2c5b98f77cc063f646f04408be874cf2674c599285f34cd81e92aa0
MD5 5cfe30688bf606f9de614db1f9955ffe
BLAKE2b-256 a5922c36e44846910e44dcdabfba934630b423133a863363ca2460eda8f09c15

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.31-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 96a4d4539a95bd4291f3f14fa1c33d5517e9556acc89c67e435dbcd5cec0f56c
MD5 469371ce1635a4837cd2ec0de09b94f3
BLAKE2b-256 cd9cfe12db73e9e4eb3b8c758a9573fd23095c5ff8f8a822b3d311ede8e78dea

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.31-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 8784414ef6aa64b101944fdbf6a2770df504fb414517d3dfc27efe4b2eb43c16
MD5 082231834fa2c630bf8fb227b638be38
BLAKE2b-256 855e69515318f83624339b44e4c8620eef16f42dc9b1aff8d1519a5f7b470a63

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.31-cp311-cp311-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 7d3b897cc6ff1d998a1ad007b191f94163ac217fcc8ccde5ef622abf703514b6
MD5 3fabc6dab5797103178f12917e5743d7
BLAKE2b-256 99ed83bb7cdbd45795f6272db039dabd414b6c360004c9a58e6dde6492416171

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.31-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 43b4d3e0cc9f210afb363fc4e178bc681d16993cc89e3bf96f2d00e642781d4f
MD5 3174cd63ba96f085fe63ce00b349353d
BLAKE2b-256 6a61c57d362c3b69b463d6fc9a4ec685f79ffbcc51ecba12ed0d8cb23a07341f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.31-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 f7ee815c65efe282868b5c05b55d33e7377d8adaeee511feb5426707046ce61d
MD5 1a4656a63018430161f1f3d35028c797
BLAKE2b-256 d645792fbf53905f5d1c9085d9d130e2b7aa9d445d2fae3efb724746d1260dd3

See more details on using hashes here.

Provenance

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