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

Uploaded CPython 3.13Windows x86-64

gllm_agents_binary-0.4.6-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.6-cp313-cp313-macosx_13_0_x86_64.whl (2.6 MB view details)

Uploaded CPython 3.13macOS 13.0+ x86-64

gllm_agents_binary-0.4.6-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.6-cp312-cp312-win_amd64.whl (1.9 MB view details)

Uploaded CPython 3.12Windows x86-64

gllm_agents_binary-0.4.6-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.6-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.6-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.6-cp311-cp311-win_amd64.whl (2.0 MB view details)

Uploaded CPython 3.11Windows x86-64

gllm_agents_binary-0.4.6-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.6-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.6-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.6-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.6-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 f1b3afeba3e6102783e29b95817c2bf8dcb813ad1e3cad706b0254851a0b199b
MD5 9d5ce247d12cc1fc8e9373b77cb63c15
BLAKE2b-256 dac2618a95fa0e917e45aaaea55e623f429a0d891351518956ac80f0af1fe969

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.6-cp313-cp313-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 a3940c418168f268ea70e7143cc45dbfa96ef4d2e1e7a0e92a0988bc9f0b147e
MD5 ac9b9d83e5b163c48a0731a48fb6c225
BLAKE2b-256 3940b1c6bca94c09ecff745df918af0f30a7d25939e1bb5b9e715ba1c6f5a53a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.6-cp313-cp313-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 1682e41ce2b3220898bafcda51e78c8856ac5111ba901dbdfbfa81b47810e62c
MD5 24d713485002fc44b5b3da9e5198ed68
BLAKE2b-256 55938258857452538ecf2d8eff7259cf39f883f1d9eaba41ba41b97459b73413

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.6-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 bbbbb38cea5873a6d87ee15a122c354bbbc5f57e9d0dc8d9364940d97c43ef3e
MD5 cddbdbcded11772f8e31fdefa053549d
BLAKE2b-256 44895a181cf30eb94214d3ab8e6c1fd04eb3cd2f296109d971cd1ebeb23b57eb

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.6-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 434ce7e9a42ce97398e5798efb4e7bc53c84dfd4c89bb2e3d5730e81d83bf2e3
MD5 fcf11c523dff8012aaaaddeda12ffe0a
BLAKE2b-256 7a92a8b81cbe46cb40cd7db440e578d54b7b63fa683b9b0b6ce3aff907eb3629

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.6-cp312-cp312-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 e55452d498a427ab4cfc692cbc02d9befdaf40c5cd70dfa24b17bdbc4dacbc5e
MD5 02902e1f38f57d9e89448dd5f552f14d
BLAKE2b-256 6ed908cccfeff75f60c86b1a1e479ae509b7dcd74886204664b4f3039420d0bf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.6-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 6d1cecdaa9bc66a5df43be4054647ceee347a382aab07ea74f6a88f77ea36b28
MD5 73f0c587e40e4b3f4a8219e2e613406b
BLAKE2b-256 99261da59a4dafa91c42f52fe9132f18b46c388ee4f10b0c3e4aebc82aba6cdd

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.6-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 a7e10ab4fb4e699dfdf60ef319f90074c44d9959125ff1217791752a1790e43d
MD5 5ce585c023969f699f37b87796b99599
BLAKE2b-256 bbf05b7b55ac5a2aa726a2e5ab42e1d06efd155680291dcdef0b62296288df5b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.6-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 c399d131fb0a86191890c90b54c6ac82d0f2fdd5bba79a812611b1ad16dbe96a
MD5 9c7f7038e5425cf67b58ed599775a96c
BLAKE2b-256 3cd133903c7ad7c5df1d8df58590ebf79ac3ac1da5f95f6902a7d05c36afd876

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.6-cp311-cp311-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 68cd44f8e48e2cc214a281499fdcdc95eaac2685035f0ff2d9bae616e659ca28
MD5 dff9646c413a5a7b6a8318c4abb2e7e1
BLAKE2b-256 a6804a9e38d57fbd7c80880d2ec7afb6564ad6f022ecb0bad2a4afa588716589

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.6-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 15289cab6a833182a2765fd02375a763d79c292df5ec4756bced00665e51c992
MD5 24dcef8d74a6d2051558578d5ceae120
BLAKE2b-256 90d6e00b6b9e378f188b4b19cc0d32cc6485d241013638da8eb977ccf2e354c3

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.4.6-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 82e8c46318c2fad9449fb1432d1d09d5957a178e7dfd01fdb513033856a211fc
MD5 c859b79ac6dc2fa988dc76997ae3e6cc
BLAKE2b-256 23016ef3b729dba6d7b903033da53785ff87d80d571e34d95e3b6f3178410897

See more details on using hashes here.

Provenance

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