-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Add Readme example to example_test.go #298
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
Conversation
37d96c0
to
11949bb
Compare
Codecov Report
@@ Coverage Diff @@
## master #298 +/- ##
=======================================
Coverage 92.52% 92.52%
=======================================
Files 22 22
Lines 669 669
=======================================
Hits 619 619
Misses 37 37
Partials 13 13 |
.golangci.yml
Outdated
@@ -9,6 +9,9 @@ run: | |||
# Default: 1m | |||
timeout: 3m | |||
|
|||
skip-files: | |||
- example_test.go |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what exactly do we break in this file? Maybe // nolint
would be a better fit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, I fixed a bunch of issues in example_test
- only needed // nolint
in one place 😉
README.md
Outdated
|
||
``` | ||
|
||
### Other examples: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not remove examples from the README, as it's easy to reach
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
Great stuff, thank you for the PR! |
Moves the
README
examples toexample_test.go
which improves the go docs:(from a local run)

I also added executable examples under an
example
folder. This works pretty well and I suspect is what most people will end up referring to when they first start using thego-openai
package:I've removed the examples from the
README.md
- but happy to put them back...Kind of relates to #80 - but really these examples aren't really testable. The purpose of this package is to interact with external AI APIs... which to be fair is never going to have deterministic results 😅