Skip to content

Agent: add support for remote server #1644

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 40 commits into from
May 16, 2025

Conversation

alexsin368
Copy link
Collaborator

@alexsin368 alexsin368 commented May 2, 2025

Description

Add support for usage of a remote server inference endpoint. Supports Enterprise Inference.

Related PR: opea-project/GenAIExamples#1900

Issues

N/A

Type of change

List the type of change like below. Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds new functionality)
  • Breaking change (fix or feature that would break existing design and interface)
  • Others (enhancement, documentation, validation, etc.)

Dependencies

None

Tests

Tested with AgentQnA consuming this agent microservice where chat completions were showing on the UI.

Copy link
Collaborator Author

@alexsin368 alexsin368 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed use_remote_service

@yinghu5 yinghu5 requested review from xuechendi, yinghu5 and Copilot May 7, 2025 08:35
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for using a remote server inference endpoint by enabling the use of an API key when initializing the ChatOpenAI client. Key changes include:

  • Updating the ChatOpenAI initialization in utils.py to append "/v1" to the remote endpoint when an API key is provided.
  • Adding a new argparse argument "--api_key" and corresponding environment variable handling in config.py.
  • Updating README.md to document how to use remote servers with the new API key support.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
comps/agent/src/integrations/utils.py Adds conditional initialization of ChatOpenAI using an API key.
comps/agent/src/integrations/config.py Supports reading the api_key from environment variables.
comps/agent/src/README.md Updates documentation to instruct on running LLMs with remote servers.
Comments suppressed due to low confidence (1)

comps/agent/src/README.md:119

  • [nitpick] The documentation uses 'LLM_ENDPOINT_URL' while the configuration code expects 'llm_endpoint_url'. Consider aligning the environment variable naming for consistency.
- `LLM_ENDPOINT_URL`=<inference-endpoint>

@yinghu5 yinghu5 requested a review from ftian1 as a code owner May 12, 2025 01:49
Copy link
Collaborator

@yinghu5 yinghu5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

ZePan110 and others added 24 commits May 14, 2025 18:34
Signed-off-by: Ye, Xinyu <[email protected]>
Co-authored-by: Lv,Liang1 <[email protected]>
Signed-off-by: alexsin368 <[email protected]>
Signed-off-by: ZePan110 <[email protected]>
Signed-off-by: alexsin368 <[email protected]>
Signed-off-by: alexsin368 <[email protected]>
…pea-project#1643)

* bug fix for dataingest url

Signed-off-by: Mustafa <[email protected]>

* add validation function

Signed-off-by: Mustafa <[email protected]>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* validation update

Signed-off-by: Mustafa <[email protected]>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* update validation function

Signed-off-by: Mustafa <[email protected]>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Signed-off-by: Mustafa <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Signed-off-by: alexsin368 <[email protected]>
…roject#1645)

* Add MariaDB Vector third-party service

MariaDB Vector was introduced since MariaDB Server 11.7

Signed-off-by: Razvan-Liviu Varzaru <[email protected]>

* Add retriever MariaDB Vector integration

Signed-off-by: Razvan-Liviu Varzaru <[email protected]>

* Add dataprep MariaDB Vector integration

Signed-off-by: Razvan-Liviu Varzaru <[email protected]>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix CI failures

- md5 is used for the primary key not as a security hash
- fixed mariadb readme headers

Signed-off-by: Razvan-Liviu Varzaru <[email protected]>

---------

Signed-off-by: Razvan-Liviu Varzaru <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Signed-off-by: alexsin368 <[email protected]>
Signed-off-by: chensuyue <[email protected]>
Signed-off-by: alexsin368 <[email protected]>
…oject#1676)

* Expand test matrix, find all tests use 3rd party Dockerfiles

Signed-off-by: chensuyue <[email protected]>
Signed-off-by: alexsin368 <[email protected]>
Update README.md for first entry of OPEA

Signed-off-by: alexsin368 <[email protected]>
Signed-off-by: lvliang-intel <[email protected]>
Signed-off-by: alexsin368 <[email protected]>
* Fix huggingfacehub API upgrade issue

Signed-off-by: lvliang-intel <[email protected]>
Signed-off-by: alexsin368 <[email protected]>
This reverts commit b7c4acf.

Signed-off-by: alexsin368 <[email protected]>
@alexsin368
Copy link
Collaborator Author

need help resolving DCO. steps i followed are not working

Copy link
Collaborator

@louie-tsai louie-tsai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me

@alexsin368
Copy link
Collaborator Author

ready to merge!

@yinghu5 yinghu5 merged commit fcf7a5a into opea-project:main May 16, 2025
13 checks passed
@alexsin368 alexsin368 deleted the agent-remote-service branch May 16, 2025 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants