This file contains 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
# Fast API | |
``` | |
@router.get("/myExample") | |
async def mySpecialAPI( | |
session_id: UUID, | |
input="Hello", | |
) -> StreamResponse: | |
# Note: Don't write await we need a coroutine | |
invoke = chain.ainvoke(..) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
from io import StringIO | |
import sys | |
from typing import Dict, Optional | |
from langchain.agents import load_tools | |
from langchain.agents import initialize_agent | |
from langchain.agents.tools import Tool | |
from langchain.llms import OpenAI |
This file contains 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
from io import StringIO | |
import sys | |
from typing import Dict, Optional | |
from langchain.agents import load_tools | |
from langchain.agents import initialize_agent | |
from langchain.agents.tools import Tool | |
from langchain.llms import OpenAI |
This file contains 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
public extension Result where Success == Void { | |
/// A success, storing a Success value. | |
/// | |
/// Instead of `.success(())`, now `.success` | |
static var success: Result { | |
return .success(()) | |
} | |
} |
This file contains 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
import Foundation | |
/// UserDefaultsStore, a generic UserDefaults Wrapper store | |
/// | |
/// How to use: | |
/// ``` | |
/// enum MyEnum { | |
/// case myKey | |
/// } | |
/// @UserDefaultsStore( |
This file contains 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
import Foundation | |
// MARK: - Describable | |
public protocol Describable { | |
var typeName: String { get } | |
static var typeName: String { get } | |
} | |
// MARK: - Describable extensions |
This file contains 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
import AVFoundation | |
import UIKit | |
// MARK: - Vibrations | |
public enum Vibrations { | |
/// A notification feedback type, indicating that a task has failed. | |
case error | |
/// A notification feedback type, indicating that a task has completed successfully. |
This file contains 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
import Foundation | |
/// A definition of logical conditions for constraining a search for a fetch or for in-memory filtering. | |
/// More info [here](https://www.swiftbysundell.com/articles/predicates-in-swift/) | |
/// | |
/// Sample: | |
/// | |
/// func myMethod(predicate: Predicate<MyObject>) -> Bool { | |
/// objects.contains { predicate(obj) } | |
/// } |
This file contains 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
import SwiftUI | |
/// Provides a convenient 'wrapper' around a UIView | |
public struct UIWrapping<V>: View { | |
let wrapped: AnyView | |
public var body: some View { wrapped } | |
// MARK: Initializers | |
/// Instantiates a wrapper for a `UIView` |
NewerOlder