diff options
author | kqlio67 <kqlio67@users.noreply.github.com> | 2024-10-29 21:03:05 +0100 |
---|---|---|
committer | kqlio67 <kqlio67@users.noreply.github.com> | 2024-10-29 21:03:05 +0100 |
commit | e79c8b01f58d21502c962f38c804bf81196f89fb (patch) | |
tree | e8f0d3f94d7a8834d45173272bd1307c91ba06d4 /docs/client.md | |
parent | Update (g4f/gui/server/api.py) (diff) | |
download | gpt4free-e79c8b01f58d21502c962f38c804bf81196f89fb.tar gpt4free-e79c8b01f58d21502c962f38c804bf81196f89fb.tar.gz gpt4free-e79c8b01f58d21502c962f38c804bf81196f89fb.tar.bz2 gpt4free-e79c8b01f58d21502c962f38c804bf81196f89fb.tar.lz gpt4free-e79c8b01f58d21502c962f38c804bf81196f89fb.tar.xz gpt4free-e79c8b01f58d21502c962f38c804bf81196f89fb.tar.zst gpt4free-e79c8b01f58d21502c962f38c804bf81196f89fb.zip |
Diffstat (limited to 'docs/client.md')
-rw-r--r-- | docs/client.md | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/docs/client.md b/docs/client.md index b4f351d3..388b2e4b 100644 --- a/docs/client.md +++ b/docs/client.md @@ -23,7 +23,7 @@ ## Introduction -Welcome to the G4F Client API, a cutting-edge tool for seamlessly integrating advanced AI capabilities into your Python applications. This guide is designed to facilitate your transition from using the OpenAI or Anthropic client to the G4F Client, offering enhanced features while maintaining compatibility with the existing OpenAI and Anthropic API. +Welcome to the G4F Client API, a cutting-edge tool for seamlessly integrating advanced AI capabilities into your Python applications. This guide is designed to facilitate your transition from using the OpenAI client to the G4F Client, offering enhanced features while maintaining compatibility with the existing OpenAI API. ## Getting Started ### Switching to G4F Client @@ -43,7 +43,7 @@ from g4f.client import Client as OpenAI -The G4F Client preserves the same familiar API interface as OpenAI or Anthropic, ensuring a smooth transition process. +The G4F Client preserves the same familiar API interface as OpenAI, ensuring a smooth transition process. ## Initializing the Client To utilize the G4F Client, create a new instance. **Below is an example showcasing custom providers:** @@ -62,7 +62,6 @@ client = Client( **Here’s an improved example of creating chat completions:** ```python response = client.chat.completions.create( - system="You are a helpful assistant.", model="gpt-3.5-turbo", messages=[ { @@ -75,7 +74,6 @@ response = client.chat.completions.create( ``` **This example:** - - Sets a system message to define the assistant's role - Asks a specific question `Say this is a test` - Configures various parameters like temperature and max_tokens for more control over the output - Disables streaming for a complete response @@ -313,7 +311,6 @@ while True: try: # Get GPT's response response = client.chat.completions.create( - system="You are a helpful assistant.", messages=messages, model=g4f.models.default, ) |