Hi there, I have been playing with Cursor Use Documentation.
I added a number of links in the doc settings and I try asking to the chat if it can come up with some of the code snippets in my docs.
The results are completely random, and doesn’t seems like understanding the docs at all.
I wonder if I am doing something wrong or there are limitations of this kind.
Asked for a camera API code snippet
Desired similar output from camera module documentation
@component
export class ContinuousCameraFrameExample extends BaseScriptComponent {
private cameraModule: CameraModule = require('LensStudio:CameraModule');
private cameraRequest: CameraModule.CameraRequest;
private cameraTexture: Texture;
private cameraTextureProvider: CameraTextureProvider;
@input
@hint('The image in the scene that will be showing the captured frame.')
uiImage: Image | undefined;
onAwake() {
this.createEvent('OnStartEvent').bind(() => {
this.cameraRequest = CameraModule.createCameraRequest();
this.cameraRequest.cameraId = CameraModule.CameraId.Default_Color;
this.cameraTexture = this.cameraModule.requestCamera(this.cameraRequest);
this.cameraTextureProvider = this.cameraTexture
.control as CameraTextureProvider;
this.cameraTextureProvider.onNewFrame.add((cameraFrame) => {
if (this.uiImage) {
this.uiImage.mainPass.baseTex = this.cameraTexture;
}
});
});
}
}
code result is very inaccurate
from camera_api import CameraModule, CameraRequest, CameraType
# Initialize the CameraModule
camera_module = CameraModule()
# Create a CameraRequest for the desired camera and resolution
camera_request = CameraRequest(
camera_type=CameraType.Left_Color, # Choose from Left_Color, Right_Color, or SystemDefault_Color
image_smaller_dimension=640 # Specify the smallest dimension in pixels
)
# Start receiving frames
camera_module.start_receiving_frames(camera_request)
# Callback function to handle received frames
def on_frame_received(frame):
# Process the frame (e.g., display or save it)
print("Received a frame with resolution:", frame.resolution)
# Register the callback
camera_module.set_frame_received_callback(on_frame_received)
# Stop receiving frames when done
# camera_module.stop_receiving_frames()
I did not @ the docs as I assumed that indexing in the settings was enough.
How would I @ the docs? what if I have like 10 of them, how would I go about it?
Between the doc I inserted there is a sort of a master page API with a lot of sub links.
I can manually navigate to the exact page where the code snippet is included - or information regarding that topic are included to build a code snippet.
1.But I am expecting cursor to guess something as the information has been recursively indexed?
You can run a test yourself if you’d like
2.What is the recommended docs/links I should index and how would I make my prompt more efficient?
3.Should I use large context?
4.Should I use composer?
5.Can I insert like a repo of samples where I know there is quite significant code to my project? Is that effective?
You can @ a whole doc and Cursor will find relevant sections, but can’t @ specific pages yet - you can paste specific links though and Cursor will look at those
For your specific questions:
Cursor does look through docs intelligently to find relevant sections for the AI
Large context can help but uses more fast requests - up to you if needed
Definitely use Composer, it’s the most powerful feature we have
Instead of adding repos directly, open it in Cursor and use Composer to write a markdown file explaining the structure - then use that as context in your own Composer