Skip to content

Commit

Permalink
Add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
hupe1980 committed Jul 27, 2023
1 parent 5729574 commit 7719d62
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions docs/content/en/docs/llms_and_prompts/prompt_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
title: Prompt Template
description: All about prompt templates.
weight: 40
---
```go
import "github.com/hupe1980/golc/prompt"

template := `You are a naming consultant for new companies.
What is a good name for a company that makes {{.product}}?`

pt = promt.NewTemplate(template)

p, err := pt.Format(map]string]any{
"product": "colorful socks",
})
if err != nil {
// Error handling
}

fmt.Println(p)
```
Output:
```text
You are a naming consultant for new companies.
What is a good name for a company that makes colorful socks?
```

0 comments on commit 7719d62

Please sign in to comment.