Skip to content

Commit

Permalink
typ
Browse files Browse the repository at this point in the history
  • Loading branch information
gtarpenning committed Nov 7, 2024
1 parent 81331b7 commit cbcdd33
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
TraceRefsReadBatchReq,
TraceRefsReadBatchRes,
} from './traceServerClientTypes';
import {DirectTraceServerClient} from './traceServerDirectClient';
import { DirectTraceServerClient } from './traceServerDirectClient';

const DEFAULT_BATCH_INTERVAL = 150;
const MAX_REFS_PER_BATCH = 1000;
Expand Down Expand Up @@ -110,7 +110,7 @@ export class TraceServerClient extends DirectTraceServerClient {
public feedbackCreate(req: FeedbackCreateReq): Promise<FeedbackCreateRes> {
const res = super.feedbackCreate(req).then(createRes => {
const feedbackRefResolved =
req.payload?.feedback_ref ?? this.FEEDBACK_REF_DEFAULT;
req.annotation_ref ?? this.FEEDBACK_REF_DEFAULT;
const listeners =
this.onFeedbackListeners[feedbackRefResolved][req.weave_ref] ?? [];
listeners.forEach(listener => listener());
Expand All @@ -136,7 +136,7 @@ export class TraceServerClient extends DirectTraceServerClient {
public feedbackReplace(req: FeedbackReplaceReq): Promise<FeedbackReplaceRes> {
const res = super.feedbackReplace(req).then(replaceRes => {
const feedbackRefResolved =
req.payload?.feedback_ref ?? this.FEEDBACK_REF_DEFAULT;
req.annotation_ref ?? this.FEEDBACK_REF_DEFAULT;
const listeners =
this.onFeedbackListeners[feedbackRefResolved][req.weave_ref] ?? [];
listeners.forEach(listener => listener());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Query} from './traceServerClientInterface/query';
import { Query } from './traceServerClientInterface/query';
type ExtraKeysAllowed = {
[key: string]: any;
};
Expand Down Expand Up @@ -144,6 +144,10 @@ export type FeedbackCreateReq = {
weave_ref: string;
feedback_type: string;
payload: Record<string, any>;
annotation_ref?: string;
runnable_ref?: string;
call_ref?: string;
trigger_ref?: string;
};

export type FeedbackCreateSuccess = {
Expand Down

0 comments on commit cbcdd33

Please sign in to comment.