Prompt Managemnt
Manage prompts centrally, fetch versions, and use variables for dynamic prompts
Prompt-Managemnt helps you manage prompts efficiently, retrieve specific versions, and compile prompts with dynamic variables.
Key Features
- Prompt Management: Easily create, edit, and track multiple prompt versions.
- Versioning: Supports major, minor, and patch updates for clear version control.
- Dynamic Variables: Use
{{variableName}}
placeholders that are replaced dynamically at runtime. - Statistics: Access download statistics and version history directly from the UI.
Getting started
List of Prompts via the UI

- Get a quick overview of all prompts created.
- Navigate to the Prompt in tmam.
- Explore the available prompts listed.
Create or Edit a Prompt

- Create new prompts or update existing ones.
- Click + New to start a new prompt.
- In the prompt editor, enter the prompt name, add meta properties, and use placeholders (e.g.,
{{variableName}}
) to represent dynamic values that will be substituted at runtime. - Assign a draft, major, minor, or patch version when creating or updating prompts for better version control.
View Prompt Details
Once the prompt is creaetd, You can see information about the prompt along with details on all past versions.
Access prompmts via our SDK
First, create an API Key
To authenticate your requests, you need an API key. Here’s how you can create one:
- Go to the tmam.
- Navigate to the API Keys page.
- Click on Create API Key.
- Enter a name for your API key.
- Save the API key displayed. Ensure you store it securely as it will be used for authentication in the SDK.
Then, get prompt using the SDK
Here’s how you can fetch and compile a prompt in Python:
import tmam
response = tmam.get_prompt(
url="http://api.tmam.ai/api/sdk/v1",
api_key="TMAM_API_KEY",
name="prompt_name",
should_compile=True,
variables={
"name": "Ali",
},
)
print(response)
Here’s how you can fetch and compile a prompt in Typescript/Javascript:
import tmam
const response = await tmam.getPrompts({
name: "prompt_name", // Fetch the prompt by name
shouldCompile: true, // Compile the prompt with provided variables
variables: {
name: "Ali", // Pass variables for prompt compilation
}
});
console.log(response); // Print or process the fetched and compiled prompt
Expected outcome
{
err: null,
res: {
promptId: 'a2e47d3e-6c13-4d7e-8b6e-2f7b91e3d9f4',
name: 'prompt_name',
version: '1.2.3',
tags: [ 'user', 'greeting' ],
metaProperties: { model: 'gpt4' },
prompt: 'Hello {{name}}, how are you today?',
compiledPrompt: 'Hello Ali, how are you today?'
}
}
SDK Parameters
Below are the parameters for use with the SDK:
Parameter | Description | Required/Optional |
---|---|---|
url | Sets the tmam URL. Defaults to the tmam_URL environment variable. | Required |
api_key | Sets the tmam API Key. Can also be provided via the tmam_API_KEY environment variable. | Required |
name | Sets the name to fetch a unique prompt. Use this or prompt_id . | Required* |
prompt_id | Sets the ID to fetch a unique prompt. Use this or name . | Optional* |
version | Set to True to get the prompt with variable substitution. | Optional |
shouldCompile | Boolean value that compiles the prompt using the provided variables. | Optional |
variables | Sets the variables for prompt compilation. | Optional |
meta_properties | Sets the meta-properties for storing in the prompt’s access history metadata. | Optional |
* Either name or prompt_id must be provided.