File size: 1,566 Bytes
0b3043b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import chainlit.data as cl_data
import chainlit as cl
from langsmith import traceable, Client
import uuid


class CustomDataLayer(cl_data.BaseDataLayer):
    async def upsert_feedback(self, feedback: cl_data.base.Feedback) -> str:
        client = Client()
        run_id = uuid.uuid4()
        cl.message(f"Creating feedback for run_id: {run_id} \n{feedback}")

        client.create_feedback(
            run_id,
            key="correction",
            score=feedback.value,
            comment=feedback.comment,
        )


        return await super().upsert_feedback(feedback)

    async def build_debug_url(self, *args, **kwargs):
        pass

    async def create_element(self, *args, **kwargs):
        pass

    async def create_step(self, *args, **kwargs):
        pass

    async def create_user(self, *args, **kwargs):
        pass

    async def delete_element(self, *args, **kwargs):
        pass

    async def delete_feedback(self, *args, **kwargs):
        pass

    async def delete_step(self, *args, **kwargs):
        pass

    async def delete_thread(self, *args, **kwargs):
        pass

    async def get_element(self, *args, **kwargs):
        pass

    async def get_thread(self, *args, **kwargs):
        pass

    async def get_thread_author(self, *args, **kwargs):
        pass

    async def get_user(self, *args, **kwargs):
        pass

    async def list_threads(self, *args, **kwargs):
        pass

    async def update_step(self, *args, **kwargs):
        pass

    async def update_thread(self, *args, **kwargs):
        pass