Skip to content

feat: add ability to customize API root path in service URL#143

Merged
julien-nc merged 4 commits intomainfrom
feat/api-path
Oct 16, 2024
Merged

feat: add ability to customize API root path in service URL#143
julien-nc merged 4 commits intomainfrom
feat/api-path

Conversation

@edward-ly
Copy link
Copy Markdown
Contributor

Resolves #105.

</NcTextField>
<NcButton type="tertiary"
:title="t('integration_openai', 'Leave empty to use {openaiApiUrl}', { openaiApiUrl: 'https://api.openai.com' })">
:title="t('integration_openai', 'Leave empty to use {openaiApiUrl}', { openaiApiUrl: 'https://api.openai.com/v1' })">
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

let's add v1 to line 15 too

Comment thread src/components/AdminSettings.vue Outdated
{{ t('integration_openai', 'This should include the address of your LocalAI instance (or any service implementing an API similar to OpenAI) along with the root path of the API. This URL will be accessed by your Nextcloud server.') }}
</p>
<p>
{{ t('integration_openai', 'This can be a local address with a port like {example}. In this case make sure \'allow_local_remote_servers\' is set to true in config.php', { example : 'http://localhost:8080' }) }}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

same here, v1 should be appended to the url

@kyteinsky
Copy link
Copy Markdown
Contributor

Adding a preview like a computed URL for an example endpoint like chat completions http://localhost:8080/v1/chat/completions when the service url field is modified would be convenient as Julien said here: #105 (comment)

Copy link
Copy Markdown
Member

@julien-nc julien-nc left a comment

Choose a reason for hiding this comment

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

I agree with the review from @kyteinsky . Appart from that, all good.
For appconfig values, using IAppConfig in the migration step was the right thing to do 👍

Signed-off-by: Edward Ly <contact@edward.ly>
Signed-off-by: Edward Ly <contact@edward.ly>
Signed-off-by: Edward Ly <contact@edward.ly>
Signed-off-by: Edward Ly <contact@edward.ly>
@edward-ly
Copy link
Copy Markdown
Contributor Author

Done. I decided to use another NcNoteCard to display the preview as I thought NcTextField's helperText in dark mode was too faint to be usable, but I am open to other ideas.

@edward-ly edward-ly requested a review from julien-nc October 16, 2024 05:59
Copy link
Copy Markdown
Member

@julien-nc julien-nc left a comment

Choose a reason for hiding this comment

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

👍

@julien-nc julien-nc merged commit 5361368 into main Oct 16, 2024
@edward-ly edward-ly deleted the feat/api-path branch October 16, 2024 15:01
@github-actions
Copy link
Copy Markdown

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Model selection field does not show up when trying to use perplexity openai endpoint

3 participants