Skip to content
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

Implement a tool to query ORAssistant #6226

Draft
wants to merge 53 commits into
base: master
Choose a base branch
from

Conversation

palaniappan-r
Copy link

@palaniappan-r palaniappan-r commented Nov 24, 2024

Implemented the askbot and set_bothost commands under the ora tool. They can be used to make queries to ORAssistant, a LLM based conversational assistant for OpenROAD

askbot

This command takes an argument and passes it as a query to the hosted ORAssistant backend, by making a POST request using the libcurl library.

ora_init

The ora_init command sets up user consent for using the ORAssistant and configures the host URL (if a local version is preferred).

palaniappan-r and others added 25 commits October 21, 2024 14:36
Signed-off-by: Palaniappan R <[email protected]>
Signed-off-by: Palaniappan R <[email protected]>
Signed-off-by: Palaniappan R <[email protected]>
Signed-off-by: Palaniappan R <[email protected]>
Signed-off-by: Palaniappan R <[email protected]>
Signed-off-by: Palaniappan R <[email protected]>
Signed-off-by: Palaniappan R <[email protected]>
Signed-off-by: Palaniappan R <[email protected]>
Signed-off-by: Palaniappan R <[email protected]>
Signed-off-by: Palaniappan R <[email protected]>
Signed-off-by: Palaniappan R <[email protected]>
Signed-off-by: Palaniappan R <[email protected]>
@rovinski
Copy link
Collaborator

Why can't this run locally as an add-on rather than sending requests over the internet?

@palaniappan-r
Copy link
Author

Why can't this run locally as an add-on rather than sending requests over the internet?

If the user chooses to the application locally, they'll have to follow instructions on ORAssistant's README, spin the backend server up, and use the set_bothost command to have the askbot command query the local server instead.

Currently, askbot queries a hosted version of ORAssistant by default, but I can change this if necessary.

@rovinski
Copy link
Collaborator

Is there a data control plan or disclaimer if users are sending data over the internet? GDPR may even come into play here.

@palaniappan-r palaniappan-r marked this pull request as ready for review December 21, 2024 03:14
Copy link
Contributor

@luarss luarss left a comment

Choose a reason for hiding this comment

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

Just some nits, no comments on code end

@@ -18,4 +18,4 @@ WORKDIR /OpenROAD

ENV PATH=${LOCAL_PATH}:${PATH}

RUN ./etc/Build.sh -compiler=${compiler} -threads=${numThreads} -deps-prefixes-file=${depsPrefixFile}
RUN ./etc/Build.sh -compiler=${compiler} -threads=${numThreads} -deps-prefixes-file=${depsPrefixFile}
Copy link
Contributor

Choose a reason for hiding this comment

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

why is there a change here?

Copy link
Author

Choose a reason for hiding this comment

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

Reverted.

@@ -579,7 +583,7 @@ _installDebianPackages() {
unzip \
wget \
zlib1g-dev

Copy link
Contributor

Choose a reason for hiding this comment

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

stray change?

@@ -0,0 +1,43 @@
# Copyright (c) 2024, The Regents of the University of California
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe Copyright 2025?

Copy link
Author

Choose a reason for hiding this comment

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

I've updated it now.

@palaniappan-r palaniappan-r requested a review from luarss January 4, 2025 18:26
@luarss
Copy link
Contributor

luarss commented Jan 5, 2025

@palaniappan-r no further comments from me, pending @maliberty and @vvbandeira review.

@luarss
Copy link
Contributor

luarss commented Jan 5, 2025

On second thought, I think we need to mark this as draft because the permalink is not available. I will discuss more with @dralabeing and @vvbandeira.

@palaniappan-r palaniappan-r marked this pull request as draft January 5, 2025 18:14
Copy link
Collaborator

@gadfort gadfort left a comment

Choose a reason for hiding this comment

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

There is no README for this

hostUrl
= "https://bursting-stallion-friendly.ngrok-free.app/graphs/"
"agent-retriever";
localDirPath = std::string(getenv("HOME")) + "/.local/share/openroad";
Copy link
Collaborator

Choose a reason for hiding this comment

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

why not make a helper function to generate this path since it's used in multiple locations

if (!localDir) {
logger_->info(utl::ORA, 112, "Creating ~/.local/share/openroad directory.");
std::string mkdirCmd = "mkdir -p " + localDirPath;
int ret = system(mkdirCmd.c_str());
Copy link
Collaborator

Choose a reason for hiding this comment

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

wouldn't it be better to use: https://en.cppreference.com/w/cpp/filesystem/create_directory instead of generating a system call (something I think we could avoid)

}
}

void Ora::setConsent(const char* consent)
Copy link
Collaborator

Choose a reason for hiding this comment

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

since you are checking for just a "y" for yes, I think you need to verify that this consent string matches your expectations.

}

proc set_consent { consent } {
puts "Setting ORAssistant consent to yes."
Copy link
Collaborator

Choose a reason for hiding this comment

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

what is I said "no"?

Comment on lines 1 to 5
record_tests {
set_bothost1
set_consent1
askbot1
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

all the testing needs to be moved to the CTest as this was removed.

Copy link
Author

Choose a reason for hiding this comment

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

I've moved the tests, but still have to figure out a way to start the python server (to mock API responses for tests). Previously, I started the Python server within the regression bash script itself. Could you suggest ways to handle this directly in CTest?

ora::set_bothost $hostUrl
}

proc set_consent { consent } {
Copy link
Collaborator

Choose a reason for hiding this comment

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

set_consent is an awfully generic name, it might be better as set_ora_consent

Copy link
Author

Choose a reason for hiding this comment

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

I've moved this to ora_init.

@rovinski
Copy link
Collaborator

rovinski commented Jan 6, 2025

The request for consent is a bit better than the state before, but there are still a few things I would want to see change:

  1. Default to a locally hosted copy first, or at least explicitly ask the user if it's okay to use the web-hosted version
  2. Make it explicit that only the data the user types will be sent outside the application, no other user or design data.
  3. Point to directions on how to set up a locally hosted copy on first use
  4. Don't require consent for anything other than the web-hosted copy (not only because it's not needed, but because safety guarantees can't be provided)
  5. There needs to be some kind of versioning for the consent. If there were to be a new version in the future which has a different kind of privacy policy, then you can't rely on an old consent file with a new version of OpenROAD.

@palaniappan-r
Copy link
Author

The request for consent is a bit better than the state before, but there are still a few things I would want to see change:

1. Default to a locally hosted copy first, or at least explicitly ask the user if it's okay to use the web-hosted version

2. Make it explicit that only the data the user types will be sent outside the application, no other user or design data.

3. Point to directions on how to set up a locally hosted copy on first use

4. Don't require consent for anything other than the web-hosted copy (not only because it's not needed, but because safety guarantees can't be provided)

5. There needs to be some kind of versioning for the consent. If there were to be a new version in the future which has a different kind of privacy policy, then you can't rely on an old consent file with a new version of OpenROAD.

The askbot command now requires a (y/n) consent, where y is for the web-hosted version and n is for the locally hosted version. Both the consent and the local host URL can be configured using the ora_init command.

@rovinski
Copy link
Collaborator

rovinski commented Jan 20, 2025

That doesn't really make sense - it shouldn't need to ask for consent if not connecting to the OpenROAD web-hosted version. It could be connected to another web-hosted version, in which case, it shouldn't display the message. Not only because the user wouldn't need to consent, but also the other web-hosted version may not have a privacy policy and so the consent message shouldn't claim so.

What about the other concerns?

@palaniappan-r
Copy link
Author

That doesn't really make sense - it shouldn't need to ask for consent if not connecting to the OpenROAD web-hosted version. It could be connected to another web-hosted version, in which case, it shouldn't display the message. Not only because the user wouldn't need to consent, but also the other web-hosted version may not have a privacy policy and so the consent message shouldn't claim so.

What about the other concerns?

When the askbot command is run for the first time, it displays instructions pointing to a setting up a local version. It then checks if a local url has been provided, subsequent pointing to the ora_init command to configure this. If my earlier comment wasn't clear, only this message is displayed for askbot's first use, not the consent message.

As for the consent management, it is being handed with the ora_init command, with y required for using the official web hosted version (the consent message is only displayed for this). The same command is used to connect the app to a local version. This currently requires the consent to be explicitly set to n, but I can make this automatic if need be.

I've explicitly mentioned that only the data typed-in will be sent outside the application in the consent message as well. I hope this clears your concerns, please let know if there's anything else to be addressed.

@rovinski
Copy link
Collaborator

Ok thanks, that's much clearer. I don't think using a local copy should require consent to be set to "n". If a user wants to switch between web and local they should be able to without having to constantly grant and revoke consent.

My only other concern would be a version number for the consent to make sure that in the future if the requirements ever change, the user can be reprompted. Something like

version=1
consent=y

then if version 2 comes along which requires different permissions, the user will need to re-consent.

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.

4 participants