Skip to Content
AI AssistantLLM Context

Build an AI SDK assistant

Overview

Generic AI assistants often give unreliable answers about GoCharting SDK — they mix in outdated public data or APIs from other charting libraries.

To fix that, download a single knowledge file compiled from our official documentation and TypeScript definitions. Upload it to an AI tool with a large context window, then ask library-specific questions and get answers grounded in this SDK.

File contents and prerequisites

gocharting-sdk-context.txt is built from:

  • Public markdown documentation (guides, tutorials, API reference, examples)
  • The SDK TypeScript definitions (src/types/index.d.ts)
  • A TradingView → GoCharting migration map (TV → GC Migration) for porting hosts — includes compatibility status and known limitations

Canonical download URL: https://gocharting.com/sdk/docs/gocharting-sdk-context.txt 

Before you begin:

  • File size. Regenerated with node scripts/generate-llm-context.cjs (see console for KB / token estimate). Prefer models with a large context window.
  • Model compatibility. Use a recent model that can accept large file uploads.
  • Version specificity. The file targets the latest documented SDK APIs. Examples may not match older package versions.

The exact token count varies by provider tokenizer; file size is what matters for model limits.

TradingView → GoCharting switchover

For assistants that must read TradingView Charting Library APIs and emit GoCharting code:

  1. Use the public context file (includes the migration map).
  2. Optionally build a local-only combined bundle that also embeds your TradingView context dump:
node scripts/generate-llm-context.cjs --with-tradingview "C:\path\to\charting-library-context.txt"

This writes nextra-docs/.local/gocharting-tv-migration-context.txt (not published). TradingView docs are proprietary — do not host them on the public docs site.

Upload the .local file when you need full TV reference during a migration. Instruct the model: understand TV from Part B; output only GoCharting from Part A.

How to use

The steps below use Google AI Studio as an example. Other tools that support large uploads work the same way.

  1. Download gocharting-sdk-context.txt (or the local migration bundle above).
  2. Open your AI tool and start a new chat.
  3. Upload the file into the prompt / knowledge area.
  4. Ask a concrete question, for example: “How do I hide the left toolbar?” or “Port this TradingView widget.activeChart().setVisibleRange call to GoCharting.”

The assistant should answer from the uploaded file. Prefer answers that name real GoCharting APIs (createChart, datafeed methods, widget methods, config options).

Best practices

  • Be specific. Include your framework (React, vanilla JS) and the feature you need.
  • Start a new chat for new topics. Switch chats when moving between major areas (datafeed vs trading vs theming).
  • Tune for accuracy. Prefer the strongest available model and a low temperature so the model sticks to the file.
  • Ask for code. Request a full JavaScript or TypeScript example, or the exact interface name from the definitions.
  • Verify against the docs. Treat this site as the source of truth; use doc links in answers to double-check.

Limitations and disclaimers

  • Official docs win. AI output can be wrong or incomplete. This documentation site is authoritative.
  • TradingView parity is near-complete, not identical. See the TV → GC Migration map’s Known limitations — GC does not client-aggregate higher timeframes from daily via TV-style daily_multipliers (2D / 6M / …). Hosts must return bars for the requested resolution. Quotes / depth / getServerTime and Broker / platform widgets remain incomplete or out of scope.
  • Your code, your responsibility. Generated code is informational only. Test and validate before production use. GoCharting assumes no responsibility for outcomes from AI-generated content.
  • Models can hallucinate. If an answer invents APIs from other libraries or looks wrong, rephrase or check the docs.
  • No support for third-party LLM tools. We do not provide support for Google AI Studio, ChatGPT, Claude, Cursor, or other AI products.

Regenerating the file

From the SDK package root:

node scripts/generate-llm-context.cjs # optional local TV+GC migration bundle: node scripts/generate-llm-context.cjs --with-tradingview "C:\Users\...\charting-library-context.txt"

Public output: nextra-docs/public/gocharting-sdk-context.txt.

Last updated on