Skip to content

Conversation

hoani
Copy link
Contributor

@hoani hoani commented May 3, 2023

Moves the README examples to example_test.go which improves the go docs:

(from a local run)
Screenshot 2023-05-04 at 11 01 47 AM

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 the go-openai package:

Screenshot 2023-05-04 at 11 02 55 AM

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 😅

@hoani hoani force-pushed the master branch 6 times, most recently from 37d96c0 to 11949bb Compare May 4, 2023 01:12
@codecov
Copy link

codecov bot commented May 4, 2023

Codecov Report

Merging #298 (1d3a424) into master (39abb5a) will not change coverage.
The diff coverage is n/a.

@@           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
Copy link
Owner

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?

Copy link
Contributor Author

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:
Copy link
Owner

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@sashabaranov
Copy link
Owner

Great stuff, thank you for the PR!

@hoani hoani changed the title Move readme examples to example_test.go Add Readme example to example_test.go May 5, 2023
@hoani hoani requested a review from sashabaranov May 5, 2023 20:45
@hoani hoani requested a review from sashabaranov May 7, 2023 22:23
@sashabaranov sashabaranov merged commit 5f4ff3e into sashabaranov:master May 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants