You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Prompt-Engineering-Guide/pages/prompts/creativity/new-words.de.mdx

76 lines
2.6 KiB
Markdown

# Erfindung neuer Wörter
import { Tabs, Tab } from 'nextra/components';
## Hintergrund
Dieser Prompt testet die Fähigkeit eines LLM, neue Wörter zu kreieren und sie in Sätzen zu verwenden.
## Prompt
```markdown
Ein "Whatpu" ist ein kleines, pelziges Tier, das in Tansania heimisch ist. Ein Beispiel für einen Satz, der das Wort Whatpu verwendet, ist:
Wir waren in Afrika unterwegs und haben diese sehr niedlichen Whatpus gesehen.
"Farduddle" zu machen bedeutet, wirklich schnell auf und ab zu springen. Ein Beispiel für einen Satz, der das Wort Farduddle verwendet, ist:
```
## Code / API
<Tabs items={['GPT-4 (OpenAI)', 'Mixtral MoE 8x7B Instruct (Fireworks)']}>
<Tab>
```python
from openai import OpenAI
client = OpenAI()
response = client.chat.completions.create(
model="gpt-4",
messages=[
{
"role": "user",
"content": "A \"whatpu\" is a small, furry animal native to Tanzania. An example of a sentence that uses the word whatpu is:\nWe were traveling in Africa and we saw these very cute whatpus.\n\nTo do a \"farduddle\" means to jump up and down really fast. An example of a sentence that uses the word farduddle is:"
}
],
temperature=1,
max_tokens=256,
top_p=1,
frequency_penalty=0,
presence_penalty=0
)
```
</Tab>
<Tab>
```python
import fireworks.client
fireworks.client.api_key = "<FIREWORKS_API_KEY>"
completion = fireworks.client.ChatCompletion.create(
model="accounts/fireworks/models/mixtral-8x7b-instruct",
messages=[
{
"role": "user",
"content": "A \"whatpu\" is a small, furry animal native to Tanzania. An example of a sentence that uses the word whatpu is:\nWe were traveling in Africa and we saw these very cute whatpus.\n\nTo do a \"farduddle\" means to jump up and down really fast. An example of a sentence that uses the word farduddle is:",
}
],
stop=["<|im_start|>","<|im_end|>","<|endoftext|>"],
stream=True,
n=1,
top_p=1,
top_k=40,
presence_penalty=0,
frequency_penalty=0,
prompt_truncate_len=1024,
context_length_exceeded_behavior="truncate",
temperature=0.9,
max_tokens=4000
)
```
</Tab>
</Tabs>
## Referenz
- [Sparks of Artificial General Intelligence: Early experiments with GPT-4](https://www.promptingguide.ai/techniques/fewshot) (13. April 2023)