# New Alpha Version of the SDK for Creating Custom Applications

Source: https://agenta.ai/docs/changelog/new-alpha-version-of-the-sdk-for-creating-custom-applications
Date: 2024-08-20

**

We've released a new version of the SDK for creating custom applications. This Pydantic-based SDK significantly simplifies the process of building custom applications. It's fully backward compatible, so your existing code will continue to work seamlessly. We'll soon be rolling out comprehensive documentation and examples for the new SDK.

In the meantime, here's a quick example of how to use it:

```python

from agenta import Agenta
from pydantic import BaseModel, Field

#highlight-start
ag.init()
#highlight-end

# Define the configuration of the application (that will be shown in the playground )
#highlight-start
class MyConfig(BaseModel):
    temperature: float = Field(default=0.2)
    prompt_template: str = Field(default="What is the capital of {country}?")
#highlight-end

# Creates an endpoint for the entrypoint of the application
#highlight-start
@ag.route("/", config_schema=MyConfig)
#highlight-end
def generate(country: str) -> str:
    # Fetch the config from the request
    #highlight-start
    config: MyConfig = ag.ConfigManager.get_from_route(schema=MyConfig)
    #highlight-end
    prompt = config.prompt_template.format(country=country)
    chat_completion = client.chat.completions.create(
        model="gpt-3.5-turbo",
        messages=[{"role": "user", "content": prompt}],
        temperature=config.temperature,
    )
    return chat_completion.choices[0].message.content

```

**

We've released a new version of the SDK for creating custom applications. This Pydantic-based SDK significantly simplifies the process of building custom applications. It's fully backward compatible, so your existing code will continue to work seamlessly. We'll soon be rolling out comprehensive documentation and examples for the new SDK.

In the meantime, here's a quick example of how to use it:

```python
import agenta as ag
from agenta import Agenta
from pydantic import BaseModel, Field

#highlight-start
ag.init()
#highlight-end

# Define the configuration of the application (that will be shown in the playground )
#highlight-start
class MyConfig(BaseModel):
    temperature: float = Field(default=0.2)
    prompt_template: str = Field(default="What is the capital of {country}?")
#highlight-end

# Creates an endpoint for the entrypoint of the application
#highlight-start
@ag.route("/", config_schema=MyConfig)
#highlight-end
def generate(country: str) -> str:
    # Fetch the config from the request
    #highlight-start
    config: MyConfig = ag.ConfigManager.get_from_route(schema=MyConfig)
    #highlight-end
    prompt = config.prompt_template.format(country=country)
    chat_completion = client.chat.completions.create(
        model="gpt-3.5-turbo",
        messages=[{"role": "user", "content": prompt}],
        temperature=config.temperature,
    )
    return chat_completion.choices[0].message.content

```

---
