Skip to main content

Client utilities for Iniya system

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

PROJECT-INIYA


Iniya-Secondary-Clients

This package Contains all the Secondary clients that are used by Project-Iniya for its working

Auth

  • This is used to Authentiate to the app using oauth providers like google, github which is required for searchclient/ConnectClient(in-dev)
  • The token is stored in the Windows Credentials Store using keyring
  • This has three functions: login , verify_token and logout
    • login : This is used to login to the APP
    • verify_token: this is a internal function that is used to check if the login is valid or not and then token stored in the device is correct or not
    • logout: this logs out the user from the device
  • Usage:
    from IniyaSecondaryClient.Auth import login, logout 
    
    # opens brower, follows the oauth login system
    login() 
    
    # clears out the token from the device
    logout()
    

Search Client

  • This Uses tavily Api throught our own API for rate regulation and usage limitation
  • usage:
      from IniyaSecondaryClient.Client import SearchClient
    
      # SearchClient(base_url = "https://iniyaai-backend.onrender.com/api/apis") 
      # This is the default url using our own backend system for seaching
      searchClient = SearchClient() 
    
      # search(
          query: str,
          search_depth: str = "basic",
          max_results: int = 5,
          include_domains: Optional[List[str]] = None,
          exclude_domains: Optional[List[str]] = None,
          include_answer: bool = False,
          include_raw_content: bool = False,
          **kwargs
        ) -> Dict[str, Any]:
      
      # this uses the Search function in Tavily API to return a Dict
    
      result = searchClient.search("Test query", <options>)
    
      # extract(
          urls: List[str], 
          includeImages: Optional[bool] = None,
          extractDepth: Optional[Literal["basic", "advanced"]] = None,
          format: Optional[Literal["markdown", "text"]] = None,
          timeout: Optional[int] = None,
          includeFavicon: Optional[bool] = None,
          includeUsage: Optional[bool] = None,
          query: Optional[str] = None,
          chunksPerSource: Optional[int] = None,
          **kwargs,
        ) -> Dict[str, Any]:
      
      # this uses the Extract function in Tavily API to return a Dict
    
      result = searchClient.extract(["urls"], <options>)
    
    

Audio Client

  • Auto Detects System hardware to Use the Best Quality Audio STT, TTS Available with the Users System

  • it uses Vosk, Whipser to Trascribe and Piper to Synthesize

  • It has 6 major Functions : transcribe , synthesise , set_input_device, list_usable_input_devices, start_listening and stop_listening

    • trascribe: Takes in a bytes (raw PCM int16) or np.ndarray (float32/int16) or str/Path (wav file path) and provides the Text as a String
    • synthesise: Takes in a String and returns a Raw int16 PCM bytes (22050 Hz, mono).
    • set_input_device: Takes the Device Index No. (according to Windows Input Device nos.) and uses that Input for live transcription
    • start_listening: Starts a Thread to Listen to the Input Device Set using the above function and transcrips it
    • stop_listening: Stops the Transcription thread
  • Usage:

    from IniyaSeconsdaryClient.Client import AudioClient
    
    # Doesnt Take any Parameters
    audioClient = AudioClient()
    
    # transcribe(
        self,
        audio: AudioInput,
        sample_rate: int = 16000,
        language: str = "en",
        on_partial: Optional[OnPartial] = None,
      ) -> str:
    # on_partial is a callable Function which returns a partial transcripted string if found
    
    res = audioClient.transcribe(<audio byte array>)
    
    # synthesise(
          self,
          text: str,
          play: bool = False,
          output_path: Optional[Union[str, Path]] = None,
      ) -> bytes:
    # play: uses mpv to play the synthesized audio 
    # output_path: provides the path to which the audio file has been stored
    
    res = audioClient.synthesize("Hello world, test Synthezier")
    
    # returns the list of devices which can be used as a input device for the live transcriptor
    listofusabledevices = audioClient.list_usable_input_devices()
    
    # changes the input device to idx as returned by the above function
    audioClient.set_input_device(idx)
    
    # def start_listening(
          self,
          on_result: Callable[[str], None],
          on_partial: Optional[OnPartial] = None,
      ) -> None:
    # on_partial is a callable Function which returns a partial transcripted string if found
    # on_result is also a callable Function which which returns the finnal string when the stop_listening function is called
    
    audioClient.start_listening(<on_final_result_func>)
    
    # stop_listening(self) -> None:
    # stops the transcription thread
    
    audioClient.stop_listening()
    
    

VizualizerClient

  • REQUIRES CUDA 13.0 COMPATIBLE GPU TO USE

  • uses Blenderllm (fallback as Shap-e, can also be selected) to generate 3d Models from text

  • blender has to be installed to use Blenderllm

  • it has the following functions: generate_3d

  • it has a inbulit webpage/server

  • usage:

    from IniyaSecondaryClient.Client import VizualizerClient
    
    # VizualizerClient(
        start_server: bool = True,
        engine: Optional[Literal["blenderllm", "shap-e", "auto"]] = "auto",
        blender_path: Optional[str] = None,
        blenderllm_model: str = "FreedomIntelligence/BlenderLLM",
        use_4bit: bool = True,
    )
    # start_server is used to set if a flask server will be started or not for viewing the glbs files
    # engine specifies which models will be used for generation
    # blender path is autodected if not provided otherwise the provided path is used for creating the glb files using blender
    
    vizClient = VizualizerClient()
    

    Text

    # if You are using the GUI.. then You can write the text and click generate and wait for it.. 
    
    # Otherwise Use the following fucntion 
    # generate_3d(
        self,
        prompt: str,
        filename: str = "output.glb",
        guidance_scale: float = 15.0,
        steps: int = 64,
      ) -> Path:
    # It takes in the prompt and few options and provides the path to the glb file
    
    path = vizClient.generate_3d("A Computer Cabinet")
    
    

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iniya_secondary_clients-0.1.1.tar.gz (131.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

iniya_secondary_clients-0.1.1-py3-none-any.whl (162.6 kB view details)

Uploaded Python 3

File details

Details for the file iniya_secondary_clients-0.1.1.tar.gz.

File metadata

  • Download URL: iniya_secondary_clients-0.1.1.tar.gz
  • Upload date:
  • Size: 131.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for iniya_secondary_clients-0.1.1.tar.gz
Algorithm Hash digest
SHA256 217dd4453feda53b96a9db345a6193da3547805830896873832278ddb37e78ac
MD5 98fe0437129434b02d05de150b091d38
BLAKE2b-256 0063d1e39a89b2efbe85e62c9539c233bd09b85caf7947b16da934fe2994aff5

See more details on using hashes here.

File details

Details for the file iniya_secondary_clients-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for iniya_secondary_clients-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4787a11d974db5e948cc090a9126e204afe089d48f8ca973ba6646002a2357b9
MD5 a6f090ba7ddefc36689f5805f29a40de
BLAKE2b-256 8f8acaebf0d06cee706a8b25c9e068a64fc1dc45c3ca4bf8815da539aebb5181

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page