> For the complete documentation index, see [llms.txt](https://docs.memejob.fun/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.memejob.fun/memejob/introducing-ai-agents/memejob-agent-setup-guide/creating-a-strategy/llm-assisted-strategy-builder.md).

# LLM-assisted strategy builder

Add your openAI API key([find your API key](https://platform.openai.com/api-keys)) in the strategy "Config":

<figure><img src="/files/opEUiNz6aeiUFTDU2Yqj" alt=""><figcaption></figcaption></figure>

The API key is used only during strategy authoring to generate or refine code. It is not used during strategy execution or backtesting.&#x20;

and allow ChatGPT to build the strategy for you inside the memejob strategy builder:

#### `complete(prompt)`

The complete() function is an authoring-time utility for generating text and code suggestions based on prompts. It uses a Spring AI ChatModel to assist with strategy construction, analysis, and experimentation.

#### Parameters:

* prompt [string](https://www.lua.org/manual/5.3/manual.html#6.4) The prompt to send to the AI model

#### Returns:

1. [string](https://www.lua.org/manual/5.3/manual.html#6.4) Generated completion text from the AI model

#### Usage:

```lua
local analysis = complete("build me a strategy for buying the golden cross")
```

or

```lua
local analysis = complete("Analyze the current price action and volume")
local signal   = complete("Should I buy or sell based on current indicators?")
print("AI says: " .. analysis)
```

Outputs generated via complete() are text responses and must be interpreted or translated into deterministic strategy logic before being used as signals.

Note: while feeding the memejob LUA documentation, you may use any external LLM to support you in your strategy building endeavours. HF!

{% hint style="info" %}
Once a strategy is generated or refined, it must conform to the supported syntax, execution model, and primitives described in the following reference section.
{% endhint %}
