Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Hot Fix]: Updated data type for example param in the custom application advanced guide #1134

Merged
merged 1 commit into from
Jan 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading