Skip to content

Commit be25cf1

Browse files
authored
Update README.md
1 parent 0f81836 commit be25cf1

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Swift Package for Compiler Inc's AI Backend API
44

55
## Getting started
66

7-
Login to the [Compiler Developer Dshboard](https://developer.compiler.inc/) and choose "Create a new app". Give it a name and description and you will be given an API key. Save that API key, this is the only time it will be shown to you.
7+
Login to the [Compiler Developer Dashboard](https://developer.compiler.inc/) and choose "Create a new app". Give it a name and description and you will be given an API key. Save that API key, this is the only time it will be shown to you.
88

99
On the next page you will see an app ID. You will use that in your code and set up functions for use with Compiler inside your own project next.
1010

@@ -20,7 +20,7 @@ At some central location, in your code set up a client:
2020

2121
Next you create an enum for "CompilerFunction". This enum conforms `Sendable` and contains a case for each function you're making available. for example:
2222

23-
```
23+
```swift
2424
enum CompilerFunction: Sendable {
2525
case doSomething
2626
case doSomethingElse
@@ -32,7 +32,7 @@ Note that parameters supported are: `String`, `Double`, `Float`, `Int`, `Bool`,
3232

3333
But, you'll want to add tradtional Swift-style documentation generating comments as well, because these will be use in a later step to help train the AI to best respond to your users. For instance:
3434

35-
```
35+
```swift
3636
enum CompilerFunction: Sendable {
3737
/// Users can invoke this function to make something happen
3838
case doSomething
@@ -56,7 +56,7 @@ There are more things that you'll want to add to the CompilerFunction enum, but
5656

5757
On the same page that you got your AppID you will see you available functions, which will start with only one thing, a "NoOp" which is returned when no appropriate functions were found. Head over to the "Function Builder" and open the tab for "Swift Enum Import". In the Swift text area, paste in the complete text of the `CompilerFunction` enum and submit to get back a version of your Swift enum with a `case` for `noOp` and two new functions:
5858

59-
```
59+
```swift
6060
static func from(_ function: Function<Parameter>) -> CompilerFunction? {
6161
...
6262
}
@@ -74,11 +74,11 @@ Update `describe` with words that describe the actions. This will be used in the
7474

7575
Somewhere in your SwiftUI app, add the `ChatView` SwiftUI view:
7676

77-
```
77+
```swift
7878
ChatView(state: CurrentState(bpm: metronome.tempo),
79-
dlm: dlm,
80-
describe: describe(function:),
81-
execute: execute(function:))
79+
dlm: dlm,
80+
describe: describe(function:),
81+
execute: execute(function:))
8282
```
8383

8484
The `describe` function was already created for you. The execute function is where you finally perform the actions that were requested.

0 commit comments

Comments
 (0)