Skip to content

Commit

Permalink
Merge pull request #84 from sashirestela/83-update-readme
Browse files Browse the repository at this point in the history
Update Readme and Contributing
  • Loading branch information
sashirestela authored Apr 8, 2024
2 parents bf4f5c6 + 3ef8046 commit 0170212
Show file tree
Hide file tree
Showing 23 changed files with 45 additions and 43 deletions.
82 changes: 42 additions & 40 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# Contributing
Thank you very much for your interest in contributing to the improvement of **Simple-OpenAI**. Please, follow the next guidelines.
Thank you very much for your interest in contributing to the improvement of this project. Please, follow the next guidelines.

## General Guidelines
1. Keep the code compatible with Java 11.
1. Follow existing code styles present in the project.
1. Avoid adding new dependencies as much as possible.
1. Ensure to add Javadoc where necessary.
1. Provide unit tests for your code.
1. Provide demo code to use real services. Use environment variables for credentials.
1. Large features should be discussed with maintainers before implementation. Use the [Discussion](https://github.com/sashirestela/simple-openai/discussions) section for this.

## Code Formatting
Expand All @@ -30,45 +29,48 @@ You could set your favorite IDE to be aligned to the custom code format. See det

1. Import the custom code format:

<img src="media/intellij/set_format_intellij_1.png" width="788">
- Settings > Editor > Code Style > Java > Scheme > ⚙ > Import Scheme > Eclipse XML Profile

2. Select the file on _codestyle/spotless_java_eclipseformat.xml_:
2. Select the file on _codestyle/spotless_java_eclipseformat.xml_

<img src="media/intellij/set_format_intellij_2.png" width="372">
3. In the _Imports_ tab for the previous scheme, change the values:
- In _General_ section, mark the option _Use single class import_
- In the field _Class count to use import with '*'_ put the value 99
- In the field _Names count to use static import with '*'_ put the value 99

<img src="media/intellij/set_format_intellij_3.png" width="214">

3. In the _Imports_ section, change the values as in the image:

<img src="media/intellij/set_imports_intellij_1.png" width="788">

4. At the bottom part in the _Imports_ section, change the _import statement order_ as in the image:

<img src="media/intellij/set_imports_intellij_2.png" width="583">

<img src="media/intellij/set_imports_intellij_3.png" width="583">
4. At the bottom part in the _Imports_ section, change the import statement order as:
- **import** all other imports
- **import** javax.*
- **import** java.*
- **import static** all other imports

</details>

<details>

<summary><b>VSCode</b></summary>

1. Install the extension _Language Support for Java by Red Hat_:

<img src="media/vscode/install_extension_vscode.png" width="511">
1. Install the extension _Language Support for Java by Red Hat_

2. Set the custom code format using the value _codestyle/spotless_java_eclipseformat.xml_:
2. Set the custom code format:

- Settings > Workspace > Extensions > Language Support for Java(TM) by Red Hat > Formatting
- Choose the box _Java/Format/Settings:Url_ and put the value _codestyle/spotless_java_eclipseformat.xml_

<img src="media/vscode/set_format_vscode.png" width="673">
3. Set the import order:

3. Configure the _Import Order_ by clicking in the link:
- Settings > Workspace > Extensions > Language Support for Java(TM) by Red Hat > Code Completion
- Choose the box _Java/Completion:ImportOrder_ and click the link _Edit in settings.json_
- In the editor, make sure to add the following entries:

<img src="media/vscode/set_imports_vscode_1.png" width="673">

4. Set the _import statement order_ as in the image:

<img src="media/vscode/set_imports_vscode_2.png" width="513">
```json
"java.completion.importOrder": [
"",
"javax",
"java",
"*"
]
```

</details>

Expand All @@ -78,24 +80,24 @@ You could set your favorite IDE to be aligned to the custom code format. See det

1. Import the custom code format:

<img src="media/eclipse/set_format_eclipse_1.png" width="668">

2. Select the file on _codestyle/spotless_java_eclipseformat.xml_:
- Preferences > Java > Code Style > Formatter > Import...

<img src="media/eclipse/set_format_eclipse_2.png" width="584">

<img src="media/eclipse/set_format_eclipse_3.png" width="668">
2. Select the file on _codestyle/spotless_java_eclipseformat.xml_

3. Import the custom import statement order:

<img src="media/eclipse/set_imports_eclipse_1.png" width="668">

4. Select the file on _codestyle/spotless_java.importorder_:
- Preferences > Java > Code Style > Organize Imports > Import...

<img src="media/eclipse/set_imports_eclipse_2.png" width="584">
4. Select the file on _codestyle/spotless_java.importorder_

5. In the _Organize Imports_ section, make sure you see the values as in the image:
5. In the _Organize Imports_ section, make sure the values are set as:

<img src="media/eclipse/set_imports_eclipse_3.png" width="510">
- Sorting order:
- \* - all unmatched type imports
- javax
- java
- \* - all unmatched static imports
- Number of imports needed for .*: 99
- Number of static imports needed for .*: 99

</details>
</details>
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ Full support for all of the OpenAI services:
* Assistants API (Beta)
* Assistant Stream Events (Beta) 📣

![Services](media/supported_services.png)
![OpenAI Services](media/openai_services.png)

![Assitants API](media/assistants_api.png)
![OpenAI Beta Services](media/openai_beta_services.png)

NOTE: All the responses are ```CompletableFuture<ResponseObject>```, which means they are asynchronous, but you can call the join() method to return the result value when complete.

Expand Down
Binary file removed media/assistants_api.png
Binary file not shown.
Binary file removed media/eclipse/set_format_eclipse_1.png
Binary file not shown.
Binary file removed media/eclipse/set_format_eclipse_2.png
Binary file not shown.
Binary file removed media/eclipse/set_format_eclipse_3.png
Binary file not shown.
Binary file removed media/eclipse/set_imports_eclipse_1.png
Binary file not shown.
Binary file removed media/eclipse/set_imports_eclipse_2.png
Binary file not shown.
Binary file removed media/eclipse/set_imports_eclipse_3.png
Binary file not shown.
Binary file removed media/intellij/set_format_intellij_1.png
Binary file not shown.
Binary file removed media/intellij/set_format_intellij_2.png
Binary file not shown.
Binary file removed media/intellij/set_format_intellij_3.png
Binary file not shown.
Binary file removed media/intellij/set_imports_intellij_1.png
Binary file not shown.
Binary file removed media/intellij/set_imports_intellij_2.png
Binary file not shown.
Binary file removed media/intellij/set_imports_intellij_3.png
Binary file not shown.
Binary file added media/openai_beta_services.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/openai_services.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed media/supported_services.png
Binary file not shown.
Binary file removed media/vscode/install_extension_vscode.png
Binary file not shown.
Binary file removed media/vscode/set_format_vscode.png
Binary file not shown.
Binary file removed media/vscode/set_imports_vscode_1.png
Binary file not shown.
Binary file removed media/vscode/set_imports_vscode_2.png
Binary file not shown.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>io.github.sashirestela</groupId>
<artifactId>simple-openai</artifactId>
<version>2.1.1</version>
<version>2.2.0</version>
<packaging>jar</packaging>

<name>simple-openai</name>
Expand Down

0 comments on commit 0170212

Please sign in to comment.