SciPhi API Client Documentation#

Introduction#

The SciPhi API Client is a Python library for interacting with the SciPhi API. It provides methods for performing searches, retrieving search RAG responses, generating completions, and managing client sessions.

Classes and Methods#

Model Classes#

class SearchResult#

Represents a single search result.

score#

The score of the search result.

url#

The URL of the search result.

metadata#

Optional metadata for the search result.

class SearchRAGResponse#

Represents the response from a search or RAG query.

response#

The response text.

related_queries#

A list of related queries.

search_results#

A list of SearchResult objects.

Use and Examples#

The SciPhi API Client is designed to simplify interaction with the SciPhi API. It abstracts the complexities of HTTP requests and response handling, providing a convenient interface for Python developers.

Example usage:

from sciphi import SciPhi

# Initialize the client
client = SciPhi(api_key="your_api_key")

# Perform a search
search_results = client.search("quantum computing", "wikipedia")

# Retrieve a search RAG response
rag_response = client.get_search_rag_response("natural language processing", "bing")

# Generate a completion
completion = client.completion("Explain the Turing Test", llm_model_name="SciPhi/Sensei-7B-V1

# Close the client
client.close()

By encapsulating the details of the API calls, the SciPhi API Client offers a user-friendly way to leverage the advanced search and AI capabilities of the SciPhi platform.