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

move rag tests to ollama #623

Merged
merged 5 commits into from
Aug 16, 2024
Merged

move rag tests to ollama #623

merged 5 commits into from
Aug 16, 2024

Conversation

pelikhan
Copy link
Member

@pelikhan pelikhan commented Aug 16, 2024

  • The GIT_DIFF reflects several changes across multiple files aiming to enhance and extend the functionality of the software.

  • It introduces a new variable embeddingsModel, which is fetched from environment variables, for use in the retrieval vector search function in several files including 'system.mdx', 'system.retrieval_vector_search.genai.js' and 'rag.genai.js'. 🆕

  • Changes in 'models.ts' replaced the term 'askToken' with 'withToken', which may affect how user authorization or access control is handled. 🔄

  • The most crucial changes appear to be in 'prompt_template.d.ts'. New options for embeddings models are added, expanding user choice. It means that users can now specify various text embedding models like 'openai:text-embedding-3-small', 'openai:text-embedding-3-large', 'github:text-embedding-3-small', 'github:text-embedding-3-large', 'ollama:nomic-embed-text' among others. 🚀

  • Another file 'rag.genai.js' had its model updated from 'openai:gpt-3.5-turbo' to 'ollama:phi3'. The selection of the embeddings model is also configurable in this file now. 🔄

  • In the module 'vectorsearch.ts', the endpoint url for creating embeddings has been altered slightly. Verbose logging for embedding models has also been introduced improving debugging capabilities. ✨

  • Changes in these files are user-facing as they primarily belong to the core functionality and directly affect how end users can interact with and use the system concerning embedding models and retrieval searches. 🧑‍💻

Please note that the comments and some other minor changes have been ignored as per the provided instructions.

generated by pr-describe

@@ -710,6 +710,8 @@ system({
"Function to do a search using embeddings vector similarity distance.",
})

const embeddingsModel = env.var.embeddingsModel || undefined

Choose a reason for hiding this comment

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

The variable embeddingsModel is declared but its value is never read.

generated by pr-docs-review-commit unused_variable

@@ -737,7 +739,7 @@ defTool(
const res = await retrieval.vectorSearch(
q,
files.map((filename) => ({ filename }))
)
, { embeddingsModel })

Choose a reason for hiding this comment

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

The argument label for embeddingsModel is missing in the function call.

generated by pr-docs-review-commit missing_argument_label

@@ -101,7 +101,7 @@ export async function resolveModelConnectionInfo(
const configuration = await host.getLanguageModelConfiguration(
model,
{

Choose a reason for hiding this comment

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

The token variable name has been changed from 'askToken' to 'withToken'. Please ensure that 'withToken' is defined and holds the correct value. 🕵️‍♀️

generated by pr-review-commit token_change

"github:text-embedding-3-small",
"github:text-embedding-3-large",
"ollama:nomic-embed-text"
>

Choose a reason for hiding this comment

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

The 'embeddingsModel' type has been changed and new options have been added. Please ensure that these new options are supported and handled correctly in the code. 🧐

generated by pr-review-commit embeddingsModel_change

@@ -72,10 +72,11 @@ class OpenAIEmbeddings implements EmbeddingsModel {
url = `${trimTrailingSlash(base)}/${model.replace(/\./g, "")}/embeddings?api-version=${AZURE_OPENAI_API_VERSION}`
delete body.model
} else {
url = `${base}/v1/embeddings`
url = `${base}/embeddings`

Choose a reason for hiding this comment

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

The URL endpoint for embeddings has been changed from '/v1/embeddings' to '/embeddings'. Please ensure that the new endpoint is correct and functional. 🌐

generated by pr-review-commit url_change

Copy link

The changes in the pull request contain the following:

  1. In models.ts, the token parameter name was changed from askToken to withToken.
  2. In prompt_template.d.ts, the embeddingsModel property type was extended to include additional options.
  3. In vectorsearch.ts, several changes were made:
    • The import statement was updated to include logVerbose.
    • The construction of url was modified.
    • A logVerbose call was added to log the embedding model.

These changes seem to be focused on expanding functionality, improving logging, and making minor adjustments to variable names.

As for concerns:

  • The exact purpose of renaming askToken to withToken in models.ts is not clear from the diff presented. Unless there's a specific reason for this change, this might cause unnecessary confusion for those familiar with the original name.
  • In vectorsearch.ts, the change from ${base}/v1/embeddings to ${base}/embeddings may potentially break existing functionality if there are dependencies on the previous endpoint. It's important to ensure that the new endpoint is correctly set up and that all dependent services have been updated accordingly.

Please confirm that these changes have been thoroughly tested to ensure no existing functionality is broken. Otherwise, LGTM 🚀

generated by pr-review

@@ -710,6 +710,8 @@ system({
"Function to do a search using embeddings vector similarity distance.",
})

const embeddingsModel = env.var.embeddingsModel || undefined

Choose a reason for hiding this comment

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

The variable embeddingsModel is assigned with || undefined which is redundant since an unset or nullish value defaults to undefined in JavaScript.

generated by pr-docs-review-commit unnecessary_code

@@ -737,7 +739,7 @@ defTool(
const res = await retrieval.vectorSearch(
q,
files.map((filename) => ({ filename }))
)
, { embeddingsModel })

Choose a reason for hiding this comment

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

Missing comma after the closing parenthesis of the vectorSearch function call.

generated by pr-docs-review-commit missing_comma

"github:text-embedding-3-small",
"github:text-embedding-3-large",
"ollama:nomic-embed-text"
>

Choose a reason for hiding this comment

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

The embeddingsModel options have been expanded. Please ensure that all new options are supported and correctly implemented in the code. 🧐

generated by pr-review-commit embeddings_model_change

@pelikhan pelikhan merged commit 5242c91 into main Aug 16, 2024
10 checks passed
@pelikhan pelikhan deleted the rag-ollama branch August 16, 2024 19:39
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.

1 participant