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

Setup

  • Installing the Package only from PIP/PyPI will not work. At First Run IniyaSecondaryClients.Setup.install_requirements() must be executed to install all teh required Packages

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.setupVizualizer(
        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()
    vizClient.setupVizualizer()
    

    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.2.4.tar.gz (136.4 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.2.4-py3-none-any.whl (167.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: iniya_secondary_clients-0.2.4.tar.gz
  • Upload date:
  • Size: 136.4 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.2.4.tar.gz
Algorithm Hash digest
SHA256 320803fc5aebe791e49d265708251d4525bf9217d4705c09cf5220904dc68ee9
MD5 add3d05e6dbf6c3145ba48d1a372803c
BLAKE2b-256 eace17d871068a1ac3b9271b760378ccf12c061450b827aca45a94c8279909d4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for iniya_secondary_clients-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 25e0e2ce7a81ace502ccd57b219608280f1d0a246d896f49ce3ec5dc0bd15ec0
MD5 d29a4156166d3a4d923d8189671e8ad8
BLAKE2b-256 d09c970e170410ba4bdb322cedeb28e6393e144b9a602a275997aeb7977df7d1

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