OpenAI currently runs ChatGPT for free at chat.openai.com. I’ve played around with it a bit and recently asked three questions. Those questions and ChatGPT’s responses are logged here.
ChatGPT is a type of language model called a transformer. It is trained using a variant of the transformer architecture called GPT-3 (Generative Pre-trained Transformer 3). This model is trained on a massive amount of text data using a technique called unsupervised learning, which means that it learns patterns in the data without any explicit labels or supervision. The model is pre-trained on a diverse set of internet text and fine-tuned on specific task by fine-tuning on smaller dataset. The model uses a deep neural network with attention mechanisms to generate human-like text. It can be fine-tuned for a wide range of natural language processing tasks, such as language translation, question answering, and text summarization.
C Spire is a telecommunications company based in Mississippi, USA. It provides a wide range of services including wireless, home phone, internet, and television services. The company is known for its focus on customer service and for offering customized plans and packages for its customers. C Spire also operates a number of retail stores in Mississippi and other states where it provides services. Additionally, it offers enterprise-level services such as cloud computing, data center, and cybersecurity services to businesses. The company is privately held and was founded in the 1990s.
Telecommunications companies operating in the United States are subject to a wide range of rules and regulations set by the federal government, including the Federal Communications Commission (FCC). Some of the basic rules that these companies are required to follow include:
Universal Service: Telecommunications companies are required to contribute to the Universal Service Fund, which provides support for telecommunications services in rural and low-income areas.
Interconnection: Telecommunications companies are required to interconnect with other companies to ensure that customers can reach all networks and services.
Network Neutrality: Telecommunications companies are prohibited from discriminating against or blocking lawful internet traffic, also known as “net neutrality”
Transparency: Telecommunications companies are required to provide accurate and timely information to customers about the prices, terms, and conditions of their services.
Consumer protection: Telecommunications companies are required to follow rules to protect consumers from fraud, cramming and slamming, and other deceptive practices.
Emergency Services: Telecommunications companies are required to provide 911 emergency services and meet other obligations to ensure public safety.
These are some of the basic rules that telecommunications companies operating in the United States must follow, but there are many more specific rules and regulations that apply to different types of services and different parts of the industry.
I apologize for the error in my previous response. You are correct that C Spire was founded in 1988, not the 1990s. I apologize for any confusion this may have caused.
ChatGPT is a powerful language model that can be fine-tuned for a wide range of natural language processing tasks. Some of the benefits of using ChatGPT include:
High-quality text generation: ChatGPT is trained on a large dataset of internet text, which allows it to generate human-like text that is often difficult to distinguish from text written by a human.
Customizable: ChatGPT can be fine-tuned on a smaller dataset to perform specific tasks, such as answering questions or generating text in a specific style or tone.
Efficient: ChatGPT is a highly efficient model that can be run on a wide range of devices, from high-performance servers to mobile devices, making it accessible to a wide range of users.
Versatile: ChatGPT can be used for a wide range of applications such as text completion, text generation, question answering, language translation, text summarization, and many more.
Cost effective: ChatGPT can be used for many tasks that would otherwise require human labor, which can save time and money.
In summary, ChatGPT is a versatile and efficient model that can be used to generate high-quality text, perform natural language processing tasks, and save time and money. It can be utilized by individuals, small businesses and large companies to automate various tasks, improve customer service, or creating new content.
Check out the previous version of this post if you want to compare the differences.
Spring Boot is a powerful project from the Spring ecosystem which enables developers to maximize their leverage of Spring applications. Standalone projects can be generated at start.spring.io with any other additional dependencies of Spring project included in just a few clicks.
I have created a Spring Boot demo project available on my GitHub. I use this project to demonstrate some tasks I perform regularly in Spring Boot.
If you’ve been a follower of this blog you might recall I have previously integrated Swagger UI into a Go application (check out this blog post from October 2021).
Swagger is a suite of tools which seeks to provide OpenAPI specifications and definitions. Codebases can be generated from a Swagger doc, just as an existing codebase can be documented by adding Swagger-identifiable annotations.
In this post I will show how I to integrate Springfox Swagger UI into a Spring Boot application. I will then demonstrate integrating Springdoc as an alternative, as Springfox hasn’t been updated in a while (the last commit was Oct, 2020). Springdoc supports the latest version of Spring Boot as of writing (2.7.2).
but first…
There are three MILE MARKER sections. #1 precedes the relevant code blocks for Springfox. #2 occurs after Springfox is concluded and before Springdoc code blocks begin. #3 appears after the conclusion of Springdoc.
➡️ Springfox integration (you are here)
🔜 Springdoc integration
This configuration uses an existing Spring Boot project and integrates io.springfox/swagger-boot-starter (version 3.0.0).
Add the Springfox Spring Boot starter dependency.
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-boot-starter</artifactId>
<version>3.0.0</version>
</dependency>
springfox-boot-starter
provides the following artifacts from io.springfox
:
springfox-oas
springfox-data-rest
springfox-bean-validators
springfox-swagger2
springfox-swagger-ui
Wherever your Spring Boot app starts is dependent on your project. In my demo application, this is a file called DemoApplication.java
.
In this file, only two annotations need to be added to the base class:
@EnableOpenApi
@EnableSwagger2
If it doesn’t exist yet, create a new Java class called AppConfiguration.java
. The class itself will be empty but it will have a few annotations that will enable Springfox to scan the application code and identify endpoints. You could add these annotations on the main application class but I like it this way as it feels more explicit in intention.
@Configuration
@EnableWebMvc
@ComponentScan("dev.michael.demo")
public class AppConfiguration {
}
SpringConfig.java
will implement the WebMvcConfigurer
interface. It will override a couple of methods so that Spring Boot can serve Swagger UI alongside the Spring Boot app.
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.
addResourceHandler("/swagger-ui/**")
.addResourceLocations("classpath:/META-INF/resources/webjars/springfox-swagger-ui/")
.resourceChain(false);
}
addResourceHandlers
will enable Spring Boot to find Swagger resources.
@Override
public void addViewControllers(ViewControllerRegistry registry) {
registry.addViewController("/swagger-ui/")
.setViewName("forward:" + "/swagger-ui/index.html");
}
addViewControllers
will enable Spring Boot to serve the main Swagger UI page.
Swagger UI will now automatically generate API documentation every time the Spring Boot application is started.
✔️ Springfox integration
➡️ Springdoc integration (you are here)
Optional: For an example migration from Springfox to Springdoc, look at this commit on my Redis hackathon repo.
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
<version>1.6.11</version>
</dependency>
springdoc.packages-to-scan=dev.michaellamb.demo
springdoc.paths-to-match=/api/**
springdoc.swagger-ui.path=/swagger-ui.html
springdoc.swagger-ui.enabled=true
Springdoc is a bit simpler in configuration than Springfox, relying primarily on application.properties
to determine which packages to scan to document HTTP API routes for the app and without needing to override any Spring Beans to serve the frontend.
✔️ Springfox integration
✔️ Springdoc integration
Great job! 🎉
You have a Spring Boot app ready to start developing an auto-documented HTTP API.