Skip to content

Commit dfcc4f7

Browse files
committed
adds README
1 parent 68026c4 commit dfcc4f7

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

README.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# PerplexityApiSwift
2+
3+
PerplexityApiSwift is a Swift framework that provides a convenient wrapper for the Perplexity AI API. This framework simplifies the process of making chat completion requests to Perplexity's advanced language models.
4+
5+
## Features
6+
7+
- Easy-to-use Swift interface for the Perplexity AI API
8+
- Support for multiple Perplexity AI models
9+
- Asynchronous API calls using Swift's modern concurrency features
10+
- Built-in error handling for common API issues
11+
12+
## Quick Start
13+
14+
1. Initialize the API client with your token:
15+
```swift
16+
let api = PerplexityAPI(token: "your_api_token_here")
17+
```
18+
19+
2. Make a chat completion request:
20+
```swift
21+
let messages = [Message(role: "user", content: "Hello, AI!")]
22+
let response = try await api.chatCompletion(messages: messages, model: .sonarLarge)
23+
```
24+
25+
## Models
26+
27+
The framework supports various Perplexity AI models, including:
28+
- Sonar (small, medium, large)
29+
- CodeLlama-34b
30+
- Llama-2-70b
31+
- Mistral-7b
32+
- Mixtral-8x7b
33+
34+
## Documentation
35+
36+
For detailed information about the Perplexity AI API, including available endpoints, request/response formats, and model capabilities, please refer to the official documentation:
37+
38+
[Perplexity AI API Documentation](https://docs.perplexity.ai/)
39+
40+
## License
41+
42+
[Add your license information here]
43+
44+
## Contributing
45+
46+
[Add contribution guidelines if applicable]

0 commit comments

Comments
 (0)