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.10-py3-none-any.whl (102.0 kB view details)

Uploaded Python 3

gllm_agents_binary-0.3.10-cp313-cp313-manylinux_2_31_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.3.10-cp313-cp313-macosx_13_0_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.13macOS 13.0+ x86-64

gllm_agents_binary-0.3.10-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl (1.9 MB view details)

Uploaded CPython 3.13macOS 13.0+ ARM64macOS 15.0+ ARM64

gllm_agents_binary-0.3.10-cp312-cp312-manylinux_2_31_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.3.10-cp312-cp312-macosx_13_0_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.12macOS 13.0+ x86-64

gllm_agents_binary-0.3.10-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl (1.9 MB view details)

Uploaded CPython 3.12macOS 13.0+ ARM64macOS 15.0+ ARM64

gllm_agents_binary-0.3.10-cp311-cp311-manylinux_2_31_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.3.10-cp311-cp311-macosx_13_0_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.11macOS 13.0+ x86-64

gllm_agents_binary-0.3.10-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl (1.8 MB view details)

Uploaded CPython 3.11macOS 13.0+ ARM64macOS 15.0+ ARM64

File details

Details for the file gllm_agents_binary-0.3.10-py3-none-any.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.3.10-py3-none-any.whl
Algorithm Hash digest
SHA256 7b516473cffb7f62ad38355f7f1a0f5ad00ab1961151101c667071a6681130d5
MD5 cf3b9167611df32f0d775e8accc9222b
BLAKE2b-256 0e23557bc2a32e2c15f0c0296f087d329d206e3dfd811f98f58d98e6551c42ae

See more details on using hashes here.

Provenance

The following attestation bundles were made for gllm_agents_binary-0.3.10-py3-none-any.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.10-cp313-cp313-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.3.10-cp313-cp313-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 cc4ee479708b240a8cc04edf72fc9b5b57cc534bafcf9a3a4ac059152fc81b0a
MD5 e24983fd3854c7f7ab6f06dfc44637a4
BLAKE2b-256 5f726fff1f60f0b0ace58ce0652c0f6036eceb067082440321e03279fa9ac322

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.3.10-cp313-cp313-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 932dc32e433afd0e3d2fed7d6a68c3cb7ee0988cdf5df507046d29d6372c2541
MD5 c2fc311bbc77ff114446e354ac13c86a
BLAKE2b-256 e2335a17cdc8d9c3ac978b3e5f19243d330b86b8461c40cf6b9cade21eb5a470

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.3.10-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 001276895d4c908cddfb2e757474b41ba31339331749419c2b74c305b8188934
MD5 0e08679acd7e31bee109b633ab0da4a6
BLAKE2b-256 5c3e6930aea28cb7bb2ff95ea6446bc3b294eaf6f6d0a684e4cebdf96f37d87b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.3.10-cp312-cp312-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 1a3d9276610298d7bb671f0dfa0a0e40151a42d445b1a62758e56a5a59351196
MD5 ffb1d67fd69040236568b3205d4f6780
BLAKE2b-256 c3d63a35bb4470af0a04671cfccdf0a678d1d95b8ba05ffe335d660efacc0670

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.3.10-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 cb33e778e5322ad7c0f6e5e1526adb1fab1230ede6b93731d4390f560772fd85
MD5 1236306fed3bdfb96aace73b15f56bd3
BLAKE2b-256 0b88936843dee80a06c2dee32df6f913b70a4f76a1a4fd6ec51fb43cc36959a6

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.3.10-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 261614eda78e771e468511742e143ccae23e76fcb6c97ede50798222bcd0800d
MD5 60e3ccc076e5692b59588413928646f7
BLAKE2b-256 e79cf7badbbcda873d3be1c3261ac6fb0e9e5a293876f4393d102bab465a864d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.3.10-cp311-cp311-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 d0600d2f7bc5c73495eb6d719971805be37898e4b0845a8c5d2b42c66d8c3f01
MD5 cfbba7e635404cc75d4d071985c174ee
BLAKE2b-256 e7e8e30267ee52724c138ed40d0d405e8884909d9118ccf35b7c5c0571263c14

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.3.10-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 ff0a8a9f7c13155750a4ff2240a7d8f46bd0f8863e2db227cf0344fc52622a79
MD5 7a52ec6dc426d2b96b40524641f88092
BLAKE2b-256 1737732a02295dcf72f020c7d2f54fdd9cc87892fa5ce290561c4ad6c1351163

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.3.10-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 506ae17aa6b7d7d14c107fe9e3a1b1962f825648d966889b6c8e2c2076248444
MD5 3cc028b8ef2abb4ad05b93f941951f65
BLAKE2b-256 62d72a7e214fd5784413caa292acbb3a95e05041b0315545c6cdb68a1c32b4e0

See more details on using hashes here.

Provenance

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