Skip to content

Agent: add support for remote server#1644

Merged
yinghu5 merged 40 commits intoopea-project:mainfrom
alexsin368:agent-remote-service
May 16, 2025
Merged

Agent: add support for remote server#1644
yinghu5 merged 40 commits intoopea-project:mainfrom
alexsin368:agent-remote-service

Conversation

@alexsin368
Copy link
Copy Markdown
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.

Signed-off-by: alexsin368 <alex.sin@intel.com>
Signed-off-by: alexsin368 <alex.sin@intel.com>
alexsin368 and others added 3 commits May 2, 2025 16:58
Signed-off-by: alexsin368 <alex.sin@intel.com>
…GenAIComps into agent-remote-service

Signed-off-by: alexsin368 <alex.sin@intel.com>
Copy link
Copy Markdown
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 Copilot, xuechendi and yinghu5 May 7, 2025 08:35
Copy link
Copy Markdown

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
Copy Markdown
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!

Signed-off-by: alexsin368 <alex.sin@intel.com>
ZePan110 and others added 24 commits May 14, 2025 18:34
Signed-off-by: ZePan110 <ze.pan@intel.com>
Signed-off-by: alexsin368 <alex.sin@intel.com>
Signed-off-by: Ye, Xinyu <xinyu.ye@intel.com>
Co-authored-by: Lv,Liang1 <liang1.lv@intel.com>
Signed-off-by: alexsin368 <alex.sin@intel.com>
Signed-off-by: ZePan110 <ze.pan@intel.com>
Signed-off-by: alexsin368 <alex.sin@intel.com>
Signed-off-by: alexsin368 <alex.sin@intel.com>
Signed-off-by: alexsin368 <alex.sin@intel.com>
Signed-off-by: alexsin368 <alex.sin@intel.com>
for more information, see https://pre-commit.ci

Signed-off-by: alexsin368 <alex.sin@intel.com>
for more information, see https://pre-commit.ci

Signed-off-by: alexsin368 <alex.sin@intel.com>
…pea-project#1643)

* bug fix for dataingest url

Signed-off-by: Mustafa <mustafa.cetin@intel.com>

* add validation function

Signed-off-by: Mustafa <mustafa.cetin@intel.com>

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

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

* validation update

Signed-off-by: Mustafa <mustafa.cetin@intel.com>

* [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 <mustafa.cetin@intel.com>

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

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

---------

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

* Add MariaDB Vector third-party service

MariaDB Vector was introduced since MariaDB Server 11.7

Signed-off-by: Razvan-Liviu Varzaru <razvan@mariadb.org>

* Add retriever MariaDB Vector integration

Signed-off-by: Razvan-Liviu Varzaru <razvan@mariadb.org>

* Add dataprep MariaDB Vector integration

Signed-off-by: Razvan-Liviu Varzaru <razvan@mariadb.org>

* [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 <razvan@mariadb.org>

---------

Signed-off-by: Razvan-Liviu Varzaru <razvan@mariadb.org>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Signed-off-by: alexsin368 <alex.sin@intel.com>
Signed-off-by: chensuyue <suyue.chen@intel.com>
Signed-off-by: alexsin368 <alex.sin@intel.com>
…oject#1676)

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

Signed-off-by: chensuyue <suyue.chen@intel.com>
Signed-off-by: alexsin368 <alex.sin@intel.com>
Update README.md for first entry of OPEA

Signed-off-by: alexsin368 <alex.sin@intel.com>
Signed-off-by: lvliang-intel <liang1.lv@intel.com>
Signed-off-by: alexsin368 <alex.sin@intel.com>
* Fix huggingfacehub API upgrade issue

Signed-off-by: lvliang-intel <liang1.lv@intel.com>
Signed-off-by: alexsin368 <alex.sin@intel.com>
Signed-off-by: alexsin368 <alex.sin@intel.com>
Signed-off-by: lvliang-intel <liang1.lv@intel.com>
Signed-off-by: alexsin368 <alex.sin@intel.com>
…pea-project#1694)

Signed-off-by: lvliang-intel <liang1.lv@intel.com>
Signed-off-by: alexsin368 <alex.sin@intel.com>
Signed-off-by: alexsin368 <alex.sin@intel.com>
This reverts commit b7c4acf.

Signed-off-by: alexsin368 <alex.sin@intel.com>
Signed-off-by: alexsin368 <alex.sin@intel.com>
…GenAIComps into agent-remote-service

Signed-off-by: alexsin368 <alex.sin@intel.com>
@alexsin368
Copy link
Copy Markdown
Collaborator Author

need help resolving DCO. steps i followed are not working

Copy link
Copy Markdown
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
Copy Markdown
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.