This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "tools": [ | |
| { | |
| "type": "function", | |
| "function": { | |
| "name": "codebase_search", | |
| "description": "Find snippets of code from the codebase most relevant to the search query.\nThis is a semantic search tool, so the query should ask for something semantically matching what is needed.\nIf it makes sense to only search in particular directories, please specify them in the target_directories field.\nUnless there is a clear reason to use your own search query, please just reuse the user's exact query with their wording.\nTheir exact wording/phrasing can often be helpful for the semantic search query. Keeping the same exact question format can also be helpful.", | |
| "parameters": { | |
| "type": "object", | |
| "properties": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| OPENAI_API_KEY= |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export const validateChannelConfig = z.discriminatedUnion('type', [ | |
| z.object({ | |
| type: z.literal(ChannelType.LINE), | |
| config: LineChannelConfigSchema | |
| }), | |
| z.object({ | |
| type: z.literal(ChannelType.MAIL), | |
| config: MailChannelConfigSchema | |
| }) | |
| ]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export const ChannelSchema = z.discriminatedUnion('type', [ | |
| z.object({ | |
| id: z.string(), | |
| name: z.string(), | |
| type: z.literal(ChannelType.LINE), | |
| config: LineChannelConfigSchema | |
| }), | |
| z.object({ | |
| id: z.string(), | |
| name: z.string(), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const ChannelConfigSchema = z.union([ | |
| LineChannelConfigSchema, | |
| MailChannelConfigSchema | |
| ]) | |
| export const ChannelSchema = z.object({ | |
| id: z.string(), | |
| name: z.string(), | |
| type: z.nativeEnum(ChannelType), | |
| config: ChannelConfigSchema |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8" /> | |
| <link rel="icon" href="data:image/x-icon;base64,AAABAAEAEBAAAAEACABoBQAAFgAAACgAAAAQAAAAIAAAAAEACAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAAAADcYNABPANwCg5q4A7PvsAAPEAwBKz2YA9/33ANX11QCI35oAkeWRAPL88gAFvCsAI8RFAL/uyQAzyFIAHsNAAPj9+AAszSwA8/zzAJLiowCq66oA6frpAADDAACl6qUAP9I/ACjGSQCg6aAAOtE6AGzcbAAozCgABsQGABG/NQCs6bkAGsI9APn9+gBX0nEA4PjgAL7wvgD9//0AFMgUAM7zzgCe5a0Add91AALDAgDm+eYA9Pz2ACXFRgDh+OEAv/C/AP7//gBy2YcAa9iCAPn++QAyzzIAxfHFAPb89wA90T0A4vjiAJ7ongBFzWEA////AD7MXAAWyBYAXdR2AFXXVQD6/voALs4uAAzGDACx7bEAF8E7ADbJVQDB8MEAArwpABHANgC87scAF8gXAN733gB433gA6/ruADTPNAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8" /> | |
| <link rel="icon" href="data:image/x-icon;base64,AAABAAEAEBAAAAEACABoBQAAFgAAACgAAAAQAAAAIAAAAAEACAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAAAADcYNABPANwCg5q4A7PvsAAPEAwBKz2YA9/33ANX11QCI35oAkeWRAPL88gAFvCsAI8RFAL/uyQAzyFIAHsNAAPj9+AAszSwA8/zzAJLiowCq66oA6frpAADDAACl6qUAP9I/ACjGSQCg6aAAOtE6AGzcbAAozCgABsQGABG/NQCs6bkAGsI9APn9+gBX0nEA4PjgAL7wvgD9//0AFMgUAM7zzgCe5a0Add91AALDAgDm+eYA9Pz2ACXFRgDh+OEAv/C/AP7//gBy2YcAa9iCAPn++QAyzzIAxfHFAPb89wA90T0A4vjiAJ7ongBFzWEA////AD7MXAAWyBYAXdR2AFXXVQD6/voALs4uAAzGDACx7bEAF8E7ADbJVQDB8MEAArwpABHANgC87scAF8gXAN733gB433gA6/ruADTPNAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Authed: | |
| def __init__(self, func: typing.Callable[[str], None]): | |
| self.func = func | |
| self.checked_times = 0 | |
| def __call__(self, arg: str): | |
| print('checking auth....OK') | |
| self.checked_times += 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def filter_message(prefix: str): | |
| def inner_check(func: typing.Callable[[str], None]): | |
| def inner_deeper_check(arg: str): | |
| if arg.startswith(prefix): | |
| print('Checking prefix....OK') | |
| func(arg) | |
| print('post process...OK') | |
| else: | |
| print('Checking prefix....Failed') | |
| print('access denied') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def authed(func): | |
| def auth_check(*args, **kwargs): | |
| print("checking authentication") | |
| func(*args, **kwargs) | |
| print("post-process") | |
| return auth_check |
NewerOlder