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

Uploaded CPython 3.13Windows x86-64

gllm_agents_binary-0.2.22-cp313-cp313-manylinux_2_31_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.2.22-cp313-cp313-macosx_13_0_x86_64.macosx_15_0_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.13macOS 13.0+ x86-64macOS 15.0+ x86-64

gllm_agents_binary-0.2.22-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.13macOS 13.0+ ARM64macOS 15.0+ ARM64

gllm_agents_binary-0.2.22-cp312-cp312-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.12Windows x86-64

gllm_agents_binary-0.2.22-cp312-cp312-manylinux_2_31_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.2.22-cp312-cp312-macosx_13_0_x86_64.macosx_15_0_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.12macOS 13.0+ x86-64macOS 15.0+ x86-64

gllm_agents_binary-0.2.22-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.12macOS 13.0+ ARM64macOS 15.0+ ARM64

gllm_agents_binary-0.2.22-cp311-cp311-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.11Windows x86-64

gllm_agents_binary-0.2.22-cp311-cp311-manylinux_2_31_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.31+ x86-64

gllm_agents_binary-0.2.22-cp311-cp311-macosx_13_0_x86_64.macosx_15_0_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.11macOS 13.0+ x86-64macOS 15.0+ x86-64

gllm_agents_binary-0.2.22-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.11macOS 13.0+ ARM64macOS 15.0+ ARM64

File details

Details for the file gllm_agents_binary-0.2.22-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.22-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 672692566f3146edd118936cd7a125d701a2dafb0147c3ac6e3598ed9bd3e28d
MD5 00fbb9304ea26a16fd839ae6f862f2ad
BLAKE2b-256 9849d58f509582d8438c5f78aa11aefda5de59cf1b67e0c22e8670638bb858a0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.22-cp313-cp313-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 cbb50fc19442cbc67b2de4cf800419429309af14499a95b7600b7c391b723df4
MD5 bed95d7160f59f948a17be8b02d5d5b7
BLAKE2b-256 0b8275e9ce5131f5cf3ff539d361cd084916d27adf1ec54593852930fecfb2db

See more details on using hashes here.

File details

Details for the file gllm_agents_binary-0.2.22-cp313-cp313-macosx_13_0_x86_64.macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.22-cp313-cp313-macosx_13_0_x86_64.macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 67f83c7001fe802a4f1cd720359f6e99c243d382663c27e6b42c6b326c18b07e
MD5 62b67004b315cb58130b61277f501d98
BLAKE2b-256 5ee19ef62521cedb191f0306f4aaad47875fac88fc3047d9320bf5812d06601e

See more details on using hashes here.

Provenance

The following attestation bundles were made for gllm_agents_binary-0.2.22-cp313-cp313-macosx_13_0_x86_64.macosx_15_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.22-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.22-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 948fabd948c4d8b0763bdb1903eb4227593900bfc31e72e9fe77c5696507eca1
MD5 a55ef8b3d34ea28a75978aa3c0e081c9
BLAKE2b-256 6c2d9de51a0bda0956caf47d0f6df03dfb9edca87d9ea9dec5f37e8a9ad320bc

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.22-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 91b974b0f916f7edc446d97228530988dd0faee5756bf0951dd395340bea435a
MD5 b3e6134a25d1e794e2ab52378792a878
BLAKE2b-256 23a892c62897c620a2bb2e85870878f4cd7d87ce9180a6d4f80667876136699d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.22-cp312-cp312-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 4ad82a77788f5ffb18e800436dfd5e0b679fa11564815eac084e60c4ccc193da
MD5 81bda15b6e43061817bc33e8298caa81
BLAKE2b-256 23408bfd9e726562e9ddfcddd9a0daf9f8f14729c15736c5d154d83361aac14c

See more details on using hashes here.

File details

Details for the file gllm_agents_binary-0.2.22-cp312-cp312-macosx_13_0_x86_64.macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.22-cp312-cp312-macosx_13_0_x86_64.macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 e41496517c552ba9cc85acbe0d646017bf9d514990b800486367625935ecddcd
MD5 3cc507f65d21cce67833953151de0963
BLAKE2b-256 8607c1870a9f219aa131b8060dc219fd9395676d471120a6b302e7f768ef33b5

See more details on using hashes here.

Provenance

The following attestation bundles were made for gllm_agents_binary-0.2.22-cp312-cp312-macosx_13_0_x86_64.macosx_15_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.22-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.22-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 364892536045840a539e1689663e222a375955bffd25a107b39c8b6f59e06096
MD5 c399024e4246492cb3e2eaf45a4f93c1
BLAKE2b-256 554ad153ab83ef595e532140536ca1cde257ee32b43a3680895189d66da30b6a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.22-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 cdbaa48775f12ee8ffa130e78222e6ac79397f4cbf399c23c318baf1639f0dcc
MD5 a46799ff3765a9f937dc169622abe9db
BLAKE2b-256 ef5e938df41b93fb4556b10d81e879262b0be63c0fa218a4afbb5380e64b8107

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.22-cp311-cp311-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 954e02b864cf331ae455dfd45ff41e264813e11b42deb5ab505b39d7535a2de4
MD5 5832f3468a06637791d86744140ba057
BLAKE2b-256 8471f0f1288d8eb1711741b271f3a84253f4e2df561d2235cc3ab792cf837a8b

See more details on using hashes here.

File details

Details for the file gllm_agents_binary-0.2.22-cp311-cp311-macosx_13_0_x86_64.macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.22-cp311-cp311-macosx_13_0_x86_64.macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 75f8beadf349b0300d706cee8f9ff141b34e3e4c9e5823c23d5932072f2f7935
MD5 c6283131e7c0463b513562c712c71965
BLAKE2b-256 3c44d939b8698c5a907c6af429aeb0376498fbcf609996b7a17e893aa4d73378

See more details on using hashes here.

Provenance

The following attestation bundles were made for gllm_agents_binary-0.2.22-cp311-cp311-macosx_13_0_x86_64.macosx_15_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.22-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for gllm_agents_binary-0.2.22-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 a7d34c14fc58bab94888bb06ff4aed8000650b86c03388afb9a2ca6e06500d40
MD5 1b6b5692cab9a01bfa85ac175b3a87ef
BLAKE2b-256 a31b972e76895079aee9563b0220c677ae2254d61bd8b2b0003d470b67a66102

See more details on using hashes here.

Provenance

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