From the course: AI-Powered Development with the Anthropic API

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

Upload a stored prompt

Upload a stored prompt

- Let's work on improving this application so that it can read an external prompt. Now, I could embed a prompt directly into the application, but sometimes the prompts can be so complex that it's just better to include them as external documents that you can read. You can see that this prompt is pretty similar to what we used in the workspace before. I simplified it a bit so that it doesn't output all of the planning information. So right after this section, I'm going to open up the template from a file. So I'll say, with open('prompt.txt'), because that's the name of the file, read it as a variable called file, and we'll create a variable here called prompt_template and read the file into that variable. Next, I'm going to create a config section for Claude, so that I can call it a couple of times whenever I need to work with the prompt. This is going to be called CLAUDE_CONFIG, and it's going to have pretty much the same information that it did before, like the model, as well as the…

Contents