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.9b4-cp313-cp313-win_amd64.whl (1.9 MB view details)

Uploaded CPython 3.13Windows x86-64

gllm_agents_binary-0.4.9b4-cp313-cp313-manylinux_2_31_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.4.9b4-cp313-cp313-macosx_13_0_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.13macOS 13.0+ x86-64

gllm_agents_binary-0.4.9b4-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl (2.1 MB view details)

Uploaded CPython 3.13macOS 13.0+ ARM64macOS 15.0+ ARM64

gllm_agents_binary-0.4.9b4-cp312-cp312-win_amd64.whl (1.9 MB view details)

Uploaded CPython 3.12Windows x86-64

gllm_agents_binary-0.4.9b4-cp312-cp312-manylinux_2_31_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.4.9b4-cp312-cp312-macosx_13_0_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.12macOS 13.0+ x86-64

gllm_agents_binary-0.4.9b4-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl (2.1 MB view details)

Uploaded CPython 3.12macOS 13.0+ ARM64macOS 15.0+ ARM64

gllm_agents_binary-0.4.9b4-cp311-cp311-win_amd64.whl (2.0 MB view details)

Uploaded CPython 3.11Windows x86-64

gllm_agents_binary-0.4.9b4-cp311-cp311-manylinux_2_31_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.4.9b4-cp311-cp311-macosx_13_0_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.11macOS 13.0+ x86-64

gllm_agents_binary-0.4.9b4-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl (2.1 MB view details)

Uploaded CPython 3.11macOS 13.0+ ARM64macOS 15.0+ ARM64

File details

Details for the file gllm_agents_binary-0.4.9b4-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.9b4-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 72bd14c0d86be5790a6b124358b385000ab0d1afd6f1bc2bd8afd5b45817aaec
MD5 ca8d7d0371307af99e9de963ca35b4ea
BLAKE2b-256 6a2edd13bafddaa549c2130af4302092a5996421e8431afc44f139a0addcde22

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.9b4-cp313-cp313-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 be155fe220d7cd635ca130733b813f433c8b5d42f14dcf52e1913bb4fab20818
MD5 75ed917dc6777f447deb60e8b257a3cd
BLAKE2b-256 18e832eec3809cf0126731635b5721ffc8d5fb2a90300e978ed311a37c403bf2

See more details on using hashes here.

File details

Details for the file gllm_agents_binary-0.4.9b4-cp313-cp313-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.9b4-cp313-cp313-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 70b627e0a80c996efa8b867405d6a87538bae1e4164e91ef8ce7f97a02c9ce84
MD5 8b5e73c1cf65efae7795875ee25aa4d5
BLAKE2b-256 aa70cdc2644f803a83968a59adb07b05c620c79446232dc0fa37170aeeb59702

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.9b4-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 3e7a14dd3ad28ab1a9ef84ae39fbe2448c6de075c39e2e5df14602f8df268da6
MD5 fa838854c37e4dbbb8ff964c328a30f0
BLAKE2b-256 486c0261a566d61ab07cfdf4f09999cf8ddfbbe361b04ab03cff56106c6951d3

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.9b4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 0455645621df5f15e3b82c603ce88702dd38769d72aae3d5b0806a87fd7048a0
MD5 ced93e13d3e0e20f4252e30c509c8680
BLAKE2b-256 27af6d0aa0ce4c5d0125d980f250baad4d869eddff2d6b50a18dc4f5d87c7ab7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.9b4-cp312-cp312-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 722e314a97f445d042b92bb4a95fcf7b7a2693b98558831fc0ea91c65fb04fb4
MD5 e15b41689ba9ee3931f19df9a52a24fb
BLAKE2b-256 3a9f4e34b3b74641c6f10e0ff7e457e003dbff49cbb3ff21ada746af5413fd83

See more details on using hashes here.

File details

Details for the file gllm_agents_binary-0.4.9b4-cp312-cp312-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.9b4-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 fd289ebe2fd458adca10fb2cbcc14056904e2680bc8d2017e3842e297914050c
MD5 6fe4357987fc2f6230ffb843b66e3494
BLAKE2b-256 a85507c39b539de6755210e3361bdb4c52dd302a02f470702acfb96ae4f0c551

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.9b4-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 1cc801c0eb13504db634ebbe6f88fa785fd22ec241793fbd276d6af2b3ca12cf
MD5 3eeda4621bd74986b952c2dffd2bccae
BLAKE2b-256 79cf2bf0feafa70078e8143f8b929223236be173fc938636c594a33f52609d34

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.9b4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 1250b2aa9a4efa6a0b863c846df52ffa7a8fc30c6ef7c0673df3d8ad0973629b
MD5 313831fdad8f9a54495daf488965e0ca
BLAKE2b-256 fbef10adf9f7ddaad450f494d7db8b423f7d9cba2cc6e7c05b5d098219b95344

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.9b4-cp311-cp311-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 17cb05dbdd524e2e00346f8f42cd00d6c4bdeaef49059948eec530206de59ceb
MD5 a79331abfb6bd52dec86184b8b50f1de
BLAKE2b-256 793cbbe8fbd8ada007e08842b42efdf6328e9c28b491e1d63d860ced9ccc7923

See more details on using hashes here.

File details

Details for the file gllm_agents_binary-0.4.9b4-cp311-cp311-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.9b4-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 446fd356f2acf23f692f81def1e8d76ad672a7679e8d28efcfb799be03702a19
MD5 55e1e874383a6aa8a811692a19bc7771
BLAKE2b-256 d914aae8ce94088f2c74acfc5fb6139f5d2a67ecebeb93d4c401a6a32ca1a44d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.9b4-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 1e517fd877d9c097409fcfb85f99ead9136e7e8b57eff217b534e42da6759af2
MD5 c40385af3f8fd6ed6cb936ab8c47b927
BLAKE2b-256 0a5e00e62f5a65efe549c52f89513d831e23eb7eb85f2e165ac13a85e6af4e8d

See more details on using hashes here.

Provenance

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