The search completion object
Represents a chat completion response returned by model, based on the provided input.
- Name
id
- Type
- string
- Description
A unique identifier for the chat completion.
- Name
object
- Type
- string
- Description
The object type, which is always
search.completion
.
- Name
created
- Type
- string
- Description
A unix timestamp of when the chat completion was created.
- Name
choices
- Type
- array
- Description
A list of chat completion choices. Can be more than one if
n
is greater than 1.
- Name
choices[].index
- Type
- integer
- Description
The index of the choice in the list of choices.
- Name
choices[].message
- Type
- object
- Description
A chat completion message generated by the model.
- Name
choices[].message.role
- Type
- string
- Description
The role of the author of this message.
- Name
choices[].message.content
- Type
- string or null
- Description
The contents of the message.
- Name
choices[].finish_reason
- Type
- string
- Description
The reason the model stopped generating tokens. This will be
stop
if the model hit a natural stop point or a provided stop sequence,length
if the maximum number of tokens specified in the request was reached.
The search completion object
{
"id": "d8b98fe4adb740d0a520e7bad7edb422",
"object": "search.completion",
"created": 1692156414,
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Apple Vision Pro is an upcoming mixed-reality headset developed by Apple Inc. It was announced on June 5, 2023, at Apple's Worldwide Developers Conference. The headset is designed to bring a new dimension to powerful, personal computing by changing the way users interact with their favorite apps, capture and create content, and experience immersive digital environments³.\n\n![Apple Vision Pro](https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcT6SOsjwPQglqJP3WDgTaTetcvXc2pqm4hAoKH4uok&s=0)\n\nHere are some key features and specifications of the Apple Vision Pro:\n\n1. CPU: It is powered by the Apple M2 and R1 processors¹.\n2. Graphics: The headset features the Apple M2 (10 cores) processor running at 3.5 GHz, capable of delivering up to 3.6 TFLOPS of graphics performance¹.\n3. Input: The Apple Vision Pro incorporates 6DoF inside-out tracking, photogrammetry, and gesture recognition through 12 built-in cameras and lidar¹.\n4. Operating System: The headset runs on visionOS, which is an iOS-based operating system¹.\n5. Price: The introductory price for the Apple Vision Pro is set at US$3,499¹.\n6. Manufacturer: The manufacturing of the Apple Vision Pro is handled by Luxshare, an Apple supplier¹.\n\nThe Apple Vision Pro aims to provide users with a seamless blend of the real and digital world, enabling them to experience spatial computing like never before. It is expected to be available for purchase in the United States in early 2024 and later in other regions¹.\n\nI hope this information gives you a good understanding of Apple Vision Pro. Let me know if there's anything else you would like to know! 😊"
},
"finish_reason": "stop"
}
],
}
The search completion chunk object
Represents a streamed chunk of a search completion response returned by model, based on the provided input.
- Name
id
- Type
- string
- Description
A unique identifier for the chat completion.
- Name
object
- Type
- string
- Description
The object type, which is always
search.completion
.
- Name
created
- Type
- string
- Description
A unix timestamp of when the chat completion was created.
- Name
choices
- Type
- array
- Description
A list of chat completion choices. Can be more than one if
n
is greater than 1.
- Name
choices[].index
- Type
- integer
- Description
The index of the choice in the list of choices.
- Name
choices[].delta
- Type
- object
- Description
A chat completion delta generated by streamed model responses.
- Name
choices[].delta.role
- Type
- string
- Description
The role of the author of this message.
- Name
choices[].delta.content
- Type
- string or null
- Description
The contents of the chunk message.
- Name
choices[].finish_reason
- Type
- string or null
- Description
The reason the model stopped generating tokens. This will be
stop
if the model hit a natural stop point or a provided stop sequence,length
if the maximum number of tokens specified in the request was reached.
The search completion chunk object
{
"id": "d8b98fe4adb740d0a520e7bad7edb422",
"object": "search.completion.chunk",
"created": 1692156414,
"choices": [
{
"index": 0,
"delta": {
"role": "assistant",
"content": ""
},
"finish_reason": null
}
],
"finish": false
}
......
{
"id": "877707a665544ccbbf61fa42c722f4df",
"object": "search.completion.chunk",
"created": 1692157004,
"choices": [
{
"index": 0,
"delta": {},
"finish_reason": "stop"
}
],
"finish": true
}
[DONE]
Create search completion
Creates a model response for the given search conversation.
POST https://api.theb.ai/v1/search/completions
POST https://api.baizhi.ai/v1/search/completions
Available parameters
messages
array Required
A list of messages comprising the conversation so far.
role
string Required- The role of the messages author. One of
system
,user
orassistant
.
- The role of the messages author. One of
content
string Required- The contents of the message.
content
is required for all messages.
- The contents of the message.
stream
boolean or null Optional Defaults to false
If set, partial message deltas will be sent, like in ChatGPT. Tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a data: [DONE]
message.
Example Request
curl --location 'https://api.theb.ai/v1/search/completions' \
# curl --location 'https://api.baizhi.ai/v1/search/completions' \
--header 'Authorization: Bearer $API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"messages": [
{
"role": "user",
"content": "Tell me more about Apple Vision Pro."
}
],
"stream": false
}'
The chat completion object
{
"id": "d8b98fe4adb740d0a520e7bad7edb422",
"object": "search.completion",
"created": 1692156414,
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Apple Vision Pro is an upcoming mixed-reality headset developed by Apple Inc. It was announced on June 5, 2023, at Apple's Worldwide Developers Conference. The headset is designed to bring a new dimension to powerful, personal computing by changing the way users interact with their favorite apps, capture and create content, and experience immersive digital environments³.\n\n![Apple Vision Pro](https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcT6SOsjwPQglqJP3WDgTaTetcvXc2pqm4hAoKH4uok&s=0)\n\nHere are some key features and specifications of the Apple Vision Pro:\n\n1. CPU: It is powered by the Apple M2 and R1 processors¹.\n2. Graphics: The headset features the Apple M2 (10 cores) processor running at 3.5 GHz, capable of delivering up to 3.6 TFLOPS of graphics performance¹.\n3. Input: The Apple Vision Pro incorporates 6DoF inside-out tracking, photogrammetry, and gesture recognition through 12 built-in cameras and lidar¹.\n4. Operating System: The headset runs on visionOS, which is an iOS-based operating system¹.\n5. Price: The introductory price for the Apple Vision Pro is set at US$3,499¹.\n6. Manufacturer: The manufacturing of the Apple Vision Pro is handled by Luxshare, an Apple supplier¹.\n\nThe Apple Vision Pro aims to provide users with a seamless blend of the real and digital world, enabling them to experience spatial computing like never before. It is expected to be available for purchase in the United States in early 2024 and later in other regions¹.\n\nI hope this information gives you a good understanding of Apple Vision Pro. Let me know if there's anything else you would like to know! 😊"
},
"finish_reason": "stop"
}
]
}
Example Request
curl --location 'https://api.theb.ai/v1/search/completions' \
# curl --location 'https://api.baizhi.ai/v1/search/completions' \
--header 'Authorization: Bearer $API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"messages": [
{
"role": "user",
"content": "Tell me more about Apple Vision Pro."
}
],
"stream": true
}'
The chat completion chunk object
{
"id": "d8b98fe4adb740d0a520e7bad7edb422",
"object": "search.completion.chunk",
"created": 1692156414,
"choices": [
{
"index": 0,
"delta": {
"role": "assistant",
"content": ""
},
"finish_reason": null
}
]
}
......
{
"id": "877707a665544ccbbf61fa42c722f4df",
"object": "search.completion.chunk",
"created": 1692157004,
"choices": [
{
"index": 0,
"delta": {},
"finish_reason": "stop"
}
]
}
[DONE]
Contents Filtered
{
"error": {
"message": "This content may violate our content policy, please check https://theb.ai/legal.html to learn more. If you believe this to be in error, please contact us at [email protected] to keep our systems safe and available.",
"param": "prompt",
"reason": "content_filter",
"status": 400
}
}