Skip to content

Commit

Permalink
Merge pull request #1134 from Agenta-AI/hot-fix/advance-guide-custom-…
Browse files Browse the repository at this point in the history
…application

[Hot Fix]: Updated data type for example param in the custom application advanced guide
  • Loading branch information
mmabrouk authored Jan 2, 2024
2 parents 6f237de + fb39540 commit 2c1c853
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/advanced_guides/custom_applications.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ from openai import OpenAI

client = OpenAI()

def generate(subject:txt):
def generate(subject: str):
prompt = "Write an blog post about {subject}"
formatted_prompt = prompt.format(subject=subject)
chat_completion = client.chat.completions.create(
Expand All @@ -49,7 +49,7 @@ ag.config.register_default(prompt=ag.TextParam("Write an blog post about {subjec
client = OpenAI()

@ag.entrypoint
def generate(subject:txt):
def generate(subject: str):
formatted_prompt = ag.config.prompt.format(subject=subject)
chat_completion = client.chat.completions.create(
model="gpt-3.5-turbo", messages=[{"role": "user", "content": prompt}]
Expand Down Expand Up @@ -79,7 +79,7 @@ This tells Agenta how to render the playground for this application. In this cas
### Specifying the entrypoint of the application
```python
@ag.entrypoint
def generate(subject:txt):
def generate(subject: str):
```

We added the `@ag.entrypoint` decorator to the main function of the application. This decorator informs Agenta that this function is the entry point to the application. It converts it (using FastAPI) into an API endpoint, allowing it to be used from the web interface.
Expand Down Expand Up @@ -156,7 +156,7 @@ ag.config.register_default(prompt=TextParam("Write a blog post about {subject}")
client = OpenAI()

@ag.entrypoint
def generate(subject:txt):
def generate(subject: str):
formatted_prompt = ag.config.prompt.format(subject=subject)
chat_completion = client.chat.completions.create(
model="gpt-3.5-turbo",
Expand Down

0 comments on commit 2c1c853

Please sign in to comment.