Adapters
OpenAI
Learn how to use PromptL with OpenAI
Overview
PromptL seamlessly integrates with OpenAI’s API. By default, PromptL formats prompts in the structure required by OpenAI, so you can use the output directly without additional processing.
Basic Example
Here’s how to generate a response from OpenAI using PromptL:
Key Features
- Default Adapter: PromptL automatically uses the OpenAI adapter for correct formatting.
- Role-Based Messages: OpenAI expects a
role
field (system
,user
,assistant
) in messages, which PromptL handles for you. - Configuration Pass-Through: Configuration options (e.g.,
temperature
,model
) are passed directly to OpenAI’s API.
Error Handling
When working with OpenAI, ensure you handle potential API errors gracefully:
Next Steps
- Learn More About OpenAI’s API
- Explore advanced PromptL features: