File size: 941 Bytes
b247dc4
 
 
 
 
 
 
 
 
 
 
c635df2
b247dc4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
"""Manifest utils."""
from manifest import Manifest
from manifest.connections.client_pool import ClientConnection


def get_manifest(
    manifest_client: str,
    manifest_connection: str,
    manifest_engine: str,
) -> Manifest:
    """Get manifest engine."""
    if manifest_client in {"openai", "openaichat", "openai_mock", "openrouter", "azureendpoint", "inference_api"}:
        manifest = Manifest(
            client_name=manifest_client,
            engine=manifest_engine,
        )
    elif manifest_client in {"huggingface"}:
        manifest = Manifest(
            client_pool=[
                ClientConnection(
                    client_name=manifest_client,
                    client_connection=manifest_conn,
                )
                for manifest_conn in manifest_connection.split(";")
            ],
        )
    else:
        raise ValueError(f"Unknown manifest client {manifest_client}")
    return manifest