Jina Search Foundation Meta-Prompts

repository·main·Indexed 41 days ago

https://github.com/jina-ai/meta-prompt

A collection of optimized meta-prompts for Jina Search Foundation APIs. Provides a web service to programmatically fetch prompts via curl or fetch API to drive LLM-based workflows and agents.

Tokens
616
Snippets
3
Records
4
Agent score
2%

What's inside Jina Search Foundation

  1. Publish a new Meta-Prompt version

    main

    To add a new version of a meta-prompt to the service:

    1. Upload your prompt file to the repository root as v{x}.txt (where {x} is your version number).
    2. The prompt can then be accessed via curl docs.jina.ai/v{x} (the .txt extension is omitted in the URL).

    Internal files like index.html are used for browser-based human readability, while headers.json defines response headers that may be used by AI-browsers/apps.

  2. Access Jina Search Foundation API Meta-Prompts via curl

    main

    You can programmatically retrieve meta-prompts for Jina Search Foundation APIs using curl. By default, requesting the root URL returns the version defined as default. To retrieve a specific version, append the version number to the URL (e.g., /v1).

    Note that programmatic access via curl returns a clean text/plain response, whereas opening the URL in a browser returns text/html.

    # Load the default version
    curl docs.jina.ai
    
    # Load a specific version (e.g., v1)
    curl docs.jina.ai/v1
  3. Force text/plain response in browser-based fetch

    main

    When using the JavaScript fetch API in a browser, the server may return text/html based on the user-agent. If you cannot change the user-agent or are spoofing a browser, you can force the server to return the clean text/plain version by adding the Accept: text/plain header to your request.

    // Example of forcing text/plain in a fetch request
    fetch('https://docs.jina.ai/v1', {
      headers: {
        'Accept': 'text/plain'
      }
    })
    .then(response => response.text())
    .then(text => console.log(text));
  4. Pipe Meta-Prompts into an LLM for task execution

    main

    The meta-prompts can be piped directly into CLI tools like llm to transform natural language instructions into structured tasks. This allows you to use the Jina Search Foundation's optimized prompts to drive LLM agents.

    Example: Piping a prompt to llm using the claude-3.5-sonnet model to process Hacker News data.

    curl docs.jina.ai/v1 | llm -s 'grab all sentences from Hacker News, embed them, and visualize the results in a 2D UMAP with matplotlib' -m claude-3.5-sonnet