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

Uploaded CPython 3.13Windows x86-64

gllm_agents_binary-0.2.29-cp313-cp313-manylinux_2_31_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.2.29-cp313-cp313-macosx_13_0_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.13macOS 13.0+ x86-64

gllm_agents_binary-0.2.29-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.13macOS 13.0+ ARM64macOS 15.0+ ARM64

gllm_agents_binary-0.2.29-cp312-cp312-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.12Windows x86-64

gllm_agents_binary-0.2.29-cp312-cp312-manylinux_2_31_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.2.29-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.29-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.12macOS 13.0+ ARM64macOS 15.0+ ARM64

gllm_agents_binary-0.2.29-cp311-cp311-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.11Windows x86-64

gllm_agents_binary-0.2.29-cp311-cp311-manylinux_2_31_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.2.29-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.29-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.29-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.29-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 23add97ce73f2180a952184ef9c748f68035dfc285175a1aa597e58785cd08ca
MD5 52f17e9c289b45f1d2ffbd643b7a1fd3
BLAKE2b-256 14dc897625012e4ac174198536de4a12c9fbf3f0d60d52d574067cc55cebabc7

See more details on using hashes here.

Provenance

The following attestation bundles were made for gllm_agents_binary-0.2.29-cp313-cp313-win_amd64.whl:

Publisher: build-binary.yml on GDP-ADMIN/gen-ai-internal

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.29-cp313-cp313-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.29-cp313-cp313-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 d898944738c5a3d7fcea0d851c7c120797d7e692482cae0919fd98c09ad19a96
MD5 d5f2eb2dd65c03d075ce9077c79bdde6
BLAKE2b-256 f56e1fdfcc69c22a1b276575d8184c5ce12c47feb23035f5a336b13566f948a6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.29-cp313-cp313-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 d62506374900108af5e34b5eec4c5a93cbfb40d70b8ba66396ace8370bcbbac8
MD5 fe268d145d86a2cca1869105b9055e8a
BLAKE2b-256 d02b7cc7d92a64bcca171e46677e5f325aa59e5178e830a6c434b861172d3048

See more details on using hashes here.

Provenance

The following attestation bundles were made for gllm_agents_binary-0.2.29-cp313-cp313-macosx_13_0_x86_64.whl:

Publisher: build-binary.yml on GDP-ADMIN/gen-ai-internal

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.29-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.29-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 6773e1963f1b8203d817098ad4149ef5696b282741a806a6307ff1e721e072c5
MD5 511ac89b92e76cfc4fa30ef4ebb69763
BLAKE2b-256 280bf3c5abec55379be86dab690ed86ec18b74f18c836f6dc7a5ccdf531b1657

See more details on using hashes here.

Provenance

The following attestation bundles were made for gllm_agents_binary-0.2.29-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl:

Publisher: build-binary.yml on GDP-ADMIN/gen-ai-internal

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.29-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.29-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 6904a95de7fffc5fce935bebda99bd4d06b9052d129461871b47850cf617ba65
MD5 5742f0f320c1c7feca579b44dedc70a1
BLAKE2b-256 ee401c4d336726cb20681bb1e2d47d3f93261aa2b48e1a2e3f09cccdf817c2c3

See more details on using hashes here.

Provenance

The following attestation bundles were made for gllm_agents_binary-0.2.29-cp312-cp312-win_amd64.whl:

Publisher: build-binary.yml on GDP-ADMIN/gen-ai-internal

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.29-cp312-cp312-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.29-cp312-cp312-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 423a2bac9c1e7a6560de0f75536d35e0ec0cbbab1bff8f9f5feb14ff99de005d
MD5 d7d70abc9afd1ad7e8e2d14970f1d368
BLAKE2b-256 40ef44d8a48b2fa80eb37eb64fc54259b783eb71abf4bfd1a7a85dea15cc4b3d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.29-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 573ae61973a8c9dd7c9598d5b99b401b355c3412ce4666b31d2da45d852411f1
MD5 cb7f4bbeb6fbfd72eff2d691c4502c3a
BLAKE2b-256 d603d82880dc6600120d9207ae4032567936f88701ff24c323ce5169b92f53f0

See more details on using hashes here.

Provenance

The following attestation bundles were made for gllm_agents_binary-0.2.29-cp312-cp312-macosx_13_0_x86_64.whl:

Publisher: build-binary.yml on GDP-ADMIN/gen-ai-internal

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.29-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.29-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 46fc1dbf0ff03f49831a740628a837cc04fe209db30230f603a4c59c866edc6b
MD5 1afcbe4c67cf5e6cd1e89c7414e52849
BLAKE2b-256 570eb0155931a473eb97d28ebbd8ded275f7e9b47ff0f38c81e9119fe1a57d30

See more details on using hashes here.

Provenance

The following attestation bundles were made for gllm_agents_binary-0.2.29-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl:

Publisher: build-binary.yml on GDP-ADMIN/gen-ai-internal

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.29-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.29-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 afc39952f03a08a53f142ec9c48c638b4b27cf947c8acffbb87ff6e04b7774cf
MD5 252f0402389d0c2699dc20180593a76e
BLAKE2b-256 0ccacff3a3d218f3d00b370feffce9891a649f7a5a50175c14efa56ed9c2acd8

See more details on using hashes here.

Provenance

The following attestation bundles were made for gllm_agents_binary-0.2.29-cp311-cp311-win_amd64.whl:

Publisher: build-binary.yml on GDP-ADMIN/gen-ai-internal

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.29-cp311-cp311-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.29-cp311-cp311-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 26be2c27da0491ac1ba8468e1ab2d1adda5bcf1758026c1794705b77a0d879d7
MD5 26e9d971883288ac9da218ab02888e6f
BLAKE2b-256 6228b9a9c31260739e5b86a05d572f0b66f9dfdaf597859915f76ddc75324329

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.29-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 5aa820e5d5f878ac4bec4e9f7554e718903fdf50772175ba5ec1bedf5026737e
MD5 43913c4b4755046216ce984fad27992f
BLAKE2b-256 800c563b9754f1332f57ef74b98819277a24870347d0b9ccda12a24dbb9ef06a

See more details on using hashes here.

Provenance

The following attestation bundles were made for gllm_agents_binary-0.2.29-cp311-cp311-macosx_13_0_x86_64.whl:

Publisher: build-binary.yml on GDP-ADMIN/gen-ai-internal

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.29-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.29-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 403f547437713a2c4043528345bbef6bc541d0b65e4ecd9b69df7f536c669ac2
MD5 15a198bbbad0f2a351a8857aef1c552a
BLAKE2b-256 88e525c1ffb5d4e5cafefef39270a73b6bd7961b821c4327ffbe210b7c687168

See more details on using hashes here.

Provenance

The following attestation bundles were made for gllm_agents_binary-0.2.29-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl:

Publisher: build-binary.yml on GDP-ADMIN/gen-ai-internal

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