TabbyML / tabby

Self-hosted AI coding assistant
https://tabby.tabbyml.com/
Other
20.15k stars 918 forks source link

Issues with Receiving Context-Relevant Suggestions in Tabby Scheduler for .tabby/dataset/files.js #1534

Closed AlexWanderBit closed 1 month ago

AlexWanderBit commented 5 months ago

Hello,

I'm working with Tabby Scheduler and encountering an issue where context-relevant suggestions are not being generated as expected. Below is a detailed description of the steps I’ve taken and the problem I'm facing:

Steps to Reproduce:

I created a TypeScript file named testInterface.ts. I ran the Tabby Scheduler, which generated a new file with configurations at .tabby/dataset/files.js. The files.js contains the following content:

{ "git_url": "file:///projects/testContext", "filepath": "testInterface.ts", "content": "const testArray = [\r\n {\r\n firstProp: true,\r\n anotherProp: 123\r\n }\r\n]", "language": "javascript-typescript", "max_line_length": 23, "avg_line_length": 11.5, "alphanum_fraction": 0.556962, "tags": [] }

Using the Tabby Scheduler, I attempted to get a suggestion for the testArrayItem interface in the testInterface.ts file. Issue Description:

When I try to use the generated .tabby/dataset/files.js to obtain a relevant suggestion for the following TypeScript interface:

//Path: testInterface.ts interface testArrayItem { // Expecting context-relevant suggestions here }

I am receiving irrelevant suggestions that do not take the existing code context into account. It seems the suggestions are generic and not aligned with the testArray I have defined earlier.

Expected Behavior:

I would expect to receive suggestions that account for the predefined structure of the testArray and its properties within testInterface.ts.

Actual Behavior:

The suggestions provided by the Tabby Scheduler do not consider the code context and are not relevant to the testArrayItem interface definition.

Could you please help me understand what I might be doing wrong? Is there an issue with the functionality or is there a step in the process I'm missing?

I would appreciate any guidance on this.

Thank you for your assistance.

sirpilan commented 4 months ago

Maybe got a hint here @wsxiaoys. The context:filepath in files.js is a relative path. According to the logs the client (intellij in my case) provides an absolute path. This might be a cause to not match correctly, therefor not giving expected suggestions.

My setup:

AlexWanderBit commented 3 months ago

Hello @wsxiaoys,

Apologies for any confusion in my previous post. I just wanted to provide a more detailed outline of my current workflow and setup, and the problem I've encountered along the way.

Workflow and Current Setup:

  1. I'm successfully running the TabbyML server on Windows 11 using Docker Desktop. I'm using the following command to launch it:
    docker run -it --gpus all -p 8080:8080 -v d:/AI/.tabby:/data -v e:/projects/local:/projects tabbyml/tabby serve --model TabbyML/CodeLlama-13B --device cuda
  2. My toml file is configured with a local repository like so:
    [[repositories]]
    name = "testContext"
    git_url = "file:///projects/testContext"

Process Carried Out:

  1. After setting up, I executed the tabby scheduler --now command.
  2. The command run resulted in a new file generated at location d:/AI/.tabby/dataset/files.js.

Content of the files.js file:

{ 
    "git_url": "file:///projects/testContext", 
    "filepath": "testInterface.ts", 
    "content": "export const testArray = [\r\n\t{\r\n\t\tfirstProp: true,\r\n\t\tanotherProp: 123\r\n\t}\r\n]", 
    "language": "javascript-typescript", 
    "max_line_length": 26, 
    "avg_line_length": 11.166667, 
    "alphanum_fraction": 0.6103896, 
    "tags": [] 
}

Issue Encountered:

Even with this setup, I find that the generated suggestions for a TypeScript interface in testInterface.ts are generic and do not seem to consider the existing code context effectively enough. Therefore, I'm not getting context-relevant suggestions.

The information provided above sets the context of the issue. I am constantly referring to the Tabby's elaborate guide on Repository context for LLM assisted code completion to understand how to better integrate files into the code completion process. However, I believe I'm missing something.

Also I had a question regarding the proper syntax to specify file paths. In the Tabby guide, the syntax used to specify a 'file path' in a comment is // Path: testInterface.ts. I wanted to confirm if this is the correct and recommended style, or can we use alternatives such as // === testInterface.ts ===?

@wsxiaoys Your guidance in this matter would be greatly appreciated.

I hope this clarifies. Consequently, any further guidance from the community on this would be much appreciated. Thanks.

AlexWanderBit commented 3 months ago

@wsxiaoys Autocomplete for typescript based on repository context is completely broken even for git repositories {"git_url":"https://github.com/AlexWanderBit/testAI","filepath":"testInterface.ts","content":"export const testArray = [\r\n\t{\r\n\t\tfirstProp: true,\r\n\t\tanotherProp: 123\r\n\t}\r\n]","language":"javascript-typescript","max_line_length":26,"avg_line_length":11.166667,"alphanum_fraction":0.6103896,"tags":[]}

wsxiaoys commented 3 months ago

Hi Alex,

I'm still a bit confused about the question here. would you consider joining our slack channel for a quick huddle + screensharing on the problem? invitation: https://links.tabbyml.com/join-slack