导航菜单

页面标题

页面副标题

Perplexity v2.48.1 - t.java 源代码

正在查看: Perplexity v2.48.1 应用的 t.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package j;

import Pm.I;
import Pm.K;
import Pm.W;
import android.util.Base64;
import kotlin.jvm.internal.Intrinsics;
import l.C3107e;
import org.json.JSONObject;

public final class t {

    public final I f32572a;

    public final om.x f32573b;

    public final C3107e f32574c;

    public t(I i10, om.x xVar, C3107e c3107e) {
        Intrinsics.h(i10, "okHttpClient");
        Intrinsics.h(c3107e, "realtimeTranscriptionRepo");
        this.f32572a = i10;
        this.f32573b = xVar;
        this.f32574c = c3107e;
    }

    public static final K a(t tVar, String str) {
        tVar.getClass();
        Ha.a aVar = new Ha.a(7);
        aVar.d0("wss://api.openai.com/v1/realtime?intent=transcription");
        aVar.q("Authorization", "Bearer " + str);
        aVar.q("OpenAI-Beta", "realtime=v1");
        return aVar.u();
    }

    public static final void b(t tVar, byte[] bArr, W w2) {
        tVar.getClass();
        if (bArr.length == 0) {
            return;
        }
        JSONObject jSONObject = new JSONObject();
        jSONObject.put("type", "input_audio_buffer.append");
        jSONObject.put("audio", Base64.encodeToString(bArr, 0).toString());
        String jSONObject2 = jSONObject.toString();
        Intrinsics.g(jSONObject2, "toString(...)");
        dn.g gVar = (dn.g) w2;
        gVar.getClass();
        fn.l lVar = fn.l.z;
        if (gVar.g(1, ha.g.o(jSONObject2))) {
            return;
        }
        Jn.c.a.e(new IllegalStateException(), "Could not send audio chunk to transcription socket", new Object[0]);
    }
}